Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gi.repository import Gtk
- class Ejemplo(Gtk.Window):
- def __init__(self):
- Gtk.Window.__init__(self,title="Ejemplo RadioButon")
- self.pos = [Gtk.Orientation.HORIZONTAL,Gtk.Orientation.VERTICAL]
- self.vbox = Gtk.Box()
- self.vbox.set_spacing(5)
- self.vbox.set_orientation(self.pos[1])
- self.boton1 = Gtk.Button()
- self.boton1.set_label("Hola mundo")
- self.boton1.set_tooltip_text("Oprime para ver Hola mundo en la consola")
- self.boton1.connect("clicked", self.clic, 1)
- self.vbox.pack_start(self.boton1,True,False,10)
- self.boton2 = Gtk.Button()
- self.boton2.set_label("Salir")
- self.boton2.set_tooltip_text("Oprime para salir")
- self.boton2.connect("clicked", self.clic, 2)
- self.vbox.pack_start(self.boton2,True,False,10)
- self.add(self.vbox)
- def clic(self,boton,signal):
- if signal == 1:
- print "Hola Mundo"
- else:
- Gtk.main_quit()
- ejem = Ejemplo()
- ejem.connect("delete-event",Gtk.main_quit)
- ejem.show_all()
- Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement