[pygtk] Spinbutton

Gian Mario Tagliaretti g.tagliaretti at gmail.com
Thu Mar 30 15:43:25 WST 2006


2006/3/30, Sandro Dentella <sandro a e-den.it>:

>   why my spinbutton doesn't show '120'?

Because you didn't put an adjustment into the spinbutton.

>   why, if I write in a number, it is reset to 0 when Enter is pressed?

for the same reason :)


import gtk
w = gtk.Window()
w.connect("destroy", gtk.main_quit)
adj = gtk.Adjustment(lower=0, upper=200, step_incr=1)
spin = gtk.SpinButton(adj)
w.add(spin)
w.show_all()
spin.set_value(120)
gtk.main()

ciao
--
Gian Mario Tagliaretti
PyGTK GUI programming
http://www.parafernalia.org/pygtk/


More information about the pygtk mailing list