Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import gtk
- # This function will be called whenever you click on your button:
- def click_handler(widget) :
- # quit the application:
- gtk.main_quit()
- # Create the main window:
- win = gtk.Window()
- # Organize widgets in a vertical box:
- vbox = gtk.VBox()
- win.add(vbox)
- # Make a pushbutton:
- button = gtk.Button("Push me!")
- # When it's clicked, call our handler:
- button.connect("clicked", click_handler)
- # Add it to the window:
- vbox.pack_start(button)
- button.show()
- # Obey the window manager quit signal:
- win.connect("destroy", gtk.main_quit)
- vbox.show()
- win.show()
- gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement