[pygtk] Min and max values of multiple spinbuttons

Vláďa vladovi at atlas.cz
Sun Aug 17 18:57:46 WST 2008


If I understand your problem right, it shouldn't be difficult. There is 
a method set_range(min,max) 
(http://www.pygtk.org/docs/pygtk/class-gtkspinbutton.html#method-gtkspinbutton--set-range), 
which you can use. So whenever you change a value of one of your 
spinbutton, you have to adjust the range for the others.

Example you have values 1, 5 and 10. The range for first button is 1-4, 
the second 2-9 and the third 6-9999 (or whatever you want). Now you 
change the first spinbutton to 2, so you will have to change lower range 
of second button to 3. If you change the value of second button, you 
have to set upper and lower values for both first and third buttons.

Pretty simple I think or is there something I have missed or misunderstood?

Regards,
Vlada

Timo napsal(a):
> Hello, I have 3 spinbuttons in my program. What I want is that 
> spinbutton 1 has always the lowest value and can not be more than 
> spinbutton 2. Spinbutton 2 should always be between 1 and 3. And 
> spinbvutton 3 should always have the biggest value.
> So is there a way to stop spinbutton 1 when it reaches the vlaue (or 
> value -1) of spinbutton 2 and so on?
>
>
> Timo
> _______________________________________________
> pygtk mailing list   pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
>   


More information about the pygtk mailing list