Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gi.repository import Gtk
- class SpinButtonWindow(Gtk.Window):
- def __init__(self):
- Gtk.Window.__init__(self, title="SpinButton Demo")
- self.set_border_width(10)
- hbox = Gtk.Box(spacing=6)
- self.add(hbox)
- self.adjustment = Gtk.Adjustment(0, 0, 10, 2, 0, 0)
- self.spinbutton = Gtk.SpinButton()
- self.spinbutton.set_adjustment(self.adjustment)
- self.spinbutton.connect("value-changed", self.clic,None)
- hbox.pack_start(self.spinbutton, False, False, 0)
- def clic(self,boton,signal):
- print boton.get_value() # Con esta funcion nos devuelve un float
- print boton.get_value_as_int() # Con esta un int
- win = SpinButtonWindow()
- win.connect("delete-event", Gtk.main_quit)
- win.show_all()
- Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement