Hi all. I’m having trouble setting an upper limit for a Gtk.Adjustment. In Python, I’m creating an adjustment and a spinbutton:
adjustment = Gtk.Adjustment.new( 1 , 1 , 200 , 1 , 10, 10 )
self.spinner = Gtk.SpinButton.new( adjustment , 1 , 0 )
This works so far - or mostly anyway. I’m able to alter values in the spinbutton from 1 through to 190. Why can’t I set values up to 200? Have I created the adjustment incorrectly?
Anyway … later on in my app ( when I fetch some data ), I want to change the upper limit. I’m doing:
adjustment = self.spinner.get_adjustment()
record_count = len( self.model )
print( "set_spinner_range: we have {0} records".format( record_count ) )
adjustment.set_upper( record_count )
This results in the spinbutton being locked to 1. The value of record_count that I’m testing with here is 3, by the way. So I expected to be able to set values from 1 through to 3. What am I doing wrong?