[pygtk] Fwd: Spinbutton Set_range()

Peyman paskari007 at yahoo.ca
Fri Mar 27 01:26:17 WST 2009


Basically What I was asking is whether the set_range(lower,upper)  
method activates any other callbacks (like output(), changed()...)

Cheers


Peyman Askari

Begin forwarded message:

> From: Peyman <paskari007 at yahoo.ca>
> Date: 26 March 2009 16:04:12 GMT
> To: pygtk at daa.com.au
> Subject: Spinbutton Set_range()
>
> I have two spinbuttons, lets call them SpinButtonA and SpinButtonB,  
> whereby SpinButtonA.get_value() <= SpinButtonB.get_value()-2. I deal  
> with this by constantly updating the range of the two. I did this in  
> glade, so the paramaters are widget (the calling widget), whatever  
> data is passed, and wtree, which is used to retrieve the widgets.
>
> on _ SpinButtonA_output(widget,data,wtree):
> 	...
> 	...
> 	...
> 	SpinButtonB=wtree.get_widget('SpinButtonB')
>
> 	min=widget.get_value()+2			
> 	max= SpinButtonB.get_range()[1]
>
> 	SpinButtonB.set_range(min,max)
>
> on _ SpinButtonB_output(widget,data,wtree):
> 	...
> 	...
> 	...
> 	SpinButtonA=wtree.get_widget('SpinButtonA')
> 				
> 	min= SpinButtonA.get_range()[0]
> 	max=widget.get_value()-2
>
> 	SpinButtonA.set_range(min,max)
>
> But some funky things start happening, and the value of the two  
> spinbuttons get updated too. Does anyone know what I am doing wrong?
>
> Cheers
>
>
> Peyman Askari

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090326/aa153a0d/attachment.htm 


More information about the pygtk mailing list