|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21585/root/usr/lib64/pygtk/2.0/demos/ |
Upload File : |
#!/usr/bin/env python
'''Expander
GtkExpander allows to provide additional content that is initially hidden.
This is also known as "disclosure triangle".
'''
# pygtk version: Maik Hertha <maik.hertha@berlin.de>
import gtk
class ExpanderDemo(gtk.Dialog):
def __init__(self, parent=None):
gtk.Dialog.__init__(self, self.__class__.__name__, parent,
0,
(gtk.STOCK_CLOSE, gtk.RESPONSE_NONE))
try:
self.set_screen(parent.get_screen())
except AttributeError:
self.connect('destroy', lambda *w: gtk.main_quit())
self.connect("response", lambda d, r: d.destroy())
self.set_resizable(False)
vbox = gtk.VBox(False, 5)
self.vbox.pack_start(vbox, True, True, 0)
vbox.set_border_width(5)
label = gtk.Label()
label.set_markup("Expander demo. Click on the triangle for details.")
vbox.pack_start(label, False, False, 0)
# Create the expander
expander = gtk.Expander("Details")
vbox.pack_start(expander, False, False, 0)
# The Label for the expander
label = gtk.Label("Details can be shown or hidden.")
expander.add(label)
self.show_all()
def main():
ExpanderDemo()
gtk.main()
if __name__ == '__main__':
main()