Advertisement
hackloper775

Check gtk

Oct 22nd, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. from gi.repository import Gtk
  2.  
  3. class Ejemplo(Gtk.Window):
  4.     def __init__(self):
  5.         Gtk.Window.__init__(self,title="Ejemplo")
  6.         self.set_border_width(10)
  7.         self.cb = Gtk.CheckButton(label="Hola mundo")
  8.         self.cb.connect("toggled", self.clic, None)
  9.         self.add(self.cb)
  10.    
  11.     def clic(self,boton,sistema):
  12.         if boton.get_active():
  13.             print "Hola mundo"
  14.  
  15. ejem =  Ejemplo()
  16.  
  17. ejem.connect("delete-event",Gtk.main_quit)
  18.  
  19. ejem.show_all()
  20.  
  21. Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement