Guest User

Untitled

a guest
Jun 25th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.92 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. # ZetCode PyGTK tutorial
  4. #
  5. # This example shows four buttons
  6. # in various modes
  7. #
  8. # author: jan bodnar
  9. # website: zetcode.com
  10. # last edited: February 2009
  11.  
  12.  
  13. import gtk
  14.  
  15. class PyApp(gtk.Window):
  16.     def __init__(self):
  17.         super(PyApp, self).__init__()
  18.        
  19.         self.set_title("Buttons")
  20.         self.set_size_request(250, 200)
  21.         self.set_position(gtk.WIN_POS_CENTER)
  22.        
  23.         btn1 = gtk.Button("Button")
  24.         btn1.set_sensitive(False)
  25.         btn2 = gtk.Button("Button")
  26.         btn3 = gtk.Button(stock=gtk.STOCK_CLOSE)
  27.         btn4 = gtk.Button("Button")
  28.         btn4.set_size_request(80, 40)
  29.  
  30.         fixed = gtk.Fixed()
  31.  
  32.         fixed.put(btn1, 20, 30)
  33.         fixed.put(btn2, 100, 30)
  34.         fixed.put(btn3, 20, 80)
  35.         fixed.put(btn4, 100, 80)
  36.        
  37.         self.connect("destroy", gtk.main_quit)
  38.        
  39.         self.add(fixed)
  40.         self.show_all()
  41.  
  42.  
  43. PyApp()
  44. gtk.main()
Add Comment
Please, Sign In to add comment