Hi all -- I'm trying to create a SpinButton whose maximum value can be
changed later.  (Actually, the value of one SpinButton becomes the
maximum of another, but that's not really relevant.)  From reading the
GTK+ tutorial, it looks as though this:

"""
from gtk import *

w = GtkWindow(WINDOW_TOPLEVEL)
adj = GtkAdjustment(1, 1, 99, 1, 1, 1)
sb = GtkSpinButton(adj, 1, 0)
sb.set_wrap(True)
w.add(sb)

adj2 = sb.get_adjustment()
adj2.upper = 5
adj2.changed()
print "adj2.upper = %r" % adj2.upper
print "sb.get_adjustment().upper = %r" % sb.get_adjustment().upper

w.signal_connect("destroy", mainquit)
w.show_all()
mainloop()
"""

should work, ie. the SpinButton should have a max of 5 when it's
actually rendered.  But it doesn't; the damn thing always has a max of
99, and I cannot figure out any sequence of adj2.changed(),
sb.set_adjustment(), sb.update(), etc. that make it work as expected.

Am I missing some obvious wrinkly of GtkSpinButton and GtkAdjustment?

(Oh yeah, I'm using GTK+ 1.2 and pygtk 0.6.11, mainly because I failed
to notice the 'python2.2-gtk2' package in Debian unstable.  I'll go see
how things work if I upgrade now.)

Thanks --

        Greg
-- 
Greg Ward <[EMAIL PROTECTED]>                         http://www.gerg.ca/
I am deeply CONCERNED and I want something GOOD for BREAKFAST!
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to