Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import gtk
  4.  
  5. # This function will be called whenever you click on your button:
  6. def click_handler(widget) :
  7.     # quit the application:
  8.     gtk.main_quit()
  9.  
  10. # Create the main window:
  11. win = gtk.Window()
  12.  
  13. # Organize widgets in a vertical box:
  14. vbox = gtk.VBox()
  15. win.add(vbox)
  16.  
  17. # Make a pushbutton:
  18. button = gtk.Button("Push me!")
  19.  
  20. # When it's clicked, call our handler:
  21. button.connect("clicked", click_handler)
  22.  
  23. # Add it to the window:
  24. vbox.pack_start(button)
  25. button.show()
  26.  
  27. # Obey the window manager quit signal:
  28. win.connect("destroy", gtk.main_quit)
  29.  
  30. vbox.show()
  31. win.show()
  32. gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement