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="Que sistema usas?")
- self.set_border_width(10)
- hbox = Gtk.Box(spacing=6)
- self.add(hbox)
- rb1 = Gtk.RadioButton(label="Ubuntu",group=None)
- rb1.connect("toggled", self.clic, "Ubuntu")
- hbox.pack_start(rb1, False, False, 0)
- rb2 = Gtk.RadioButton.new_from_widget(rb1)
- rb2.set_label("Windows")
- rb2.connect("toggled", self.clic, "Windows")
- hbox.pack_start(rb2, False, False, 0)
- rb3 = Gtk.RadioButton.new_from_widget(rb1)
- rb3.set_label("MacOSX")
- rb3.connect("toggled", self.clic, "MacOSX")
- hbox.pack_start(rb3, False, False, 0)
- rb3 = Gtk.RadioButton.new_from_widget(rb1)
- rb3.set_label("Ninguno")
- rb3.connect("toggled", self.clic, "ninguno")
- hbox.pack_start(rb3, False, False, 0)
- def clic(self,boton,sistema):
- if boton.get_active():
- if sistema == "ninguno":
- print "No usas ninguno"
- else:
- print "Usas " + sistema + " :O"
- ejem = Ejemplo()
- ejem.connect("delete-event",Gtk.main_quit)
- ejem.show_all()
- Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement