Advertisement
hackloper775

Link button Gtk3

Oct 22nd, 2013
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.92 KB | None | 0 0
  1. from gi.repository import Gtk
  2.  
  3.  
  4. class Ejemplo(Gtk.Window):
  5.     def __init__(self):
  6.         Gtk.Window.__init__(self,title="Ejemplo")
  7.         self.set_border_width(10)
  8.         self.pos = [Gtk.Orientation.HORIZONTAL,Gtk.Orientation.VERTICAL]
  9.        
  10.         self.vbox = Gtk.Box()
  11.         self.vbox.set_spacing(5)
  12.         self.vbox.set_orientation(self.pos[1])
  13.        
  14.         self.lb = Gtk.LinkButton("http://www.itimetux.com", "Ejemplo por Tiempo de Tux")
  15.         self.cb = Gtk.CheckButton(label="Hola mundo")
  16.         self.cb.connect("toggled", self.clic, None)
  17.        
  18.         self.vbox.pack_start(self.cb,True,False,10)
  19.         self.vbox.pack_start(self.lb,True,False,10)
  20.        
  21.         self.add(self.vbox)
  22.    
  23.     def clic(self,boton,sistema):
  24.         if boton.get_active():
  25.             print "Hola mundo"
  26.  
  27. ejem =  Ejemplo()
  28.  
  29. ejem.connect("delete-event",Gtk.main_quit)
  30.  
  31. ejem.show_all()
  32.  
  33. Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement