Advertisement
hackloper775

ToggleButton gtk

Oct 22nd, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 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.tb = Gtk.ToggleButton(label="Hola mundo" )
  8.         self.tb.connect("toggled", self.clic, None)
  9.         self.add(self.tb)
  10.    
  11.     def clic(self,boton,sistema):
  12.         if boton.get_active():
  13.             print "Hola mundo"
  14.            
  15.  
  16. ejem =  Ejemplo()
  17.  
  18. ejem.connect("delete-event",Gtk.main_quit)
  19.  
  20. ejem.show_all()
  21.  
  22. Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement