[Glade-users] 2-digit fractional part limit on Adjustment's upper/lower bounds

Giovanni Maggiorani gmaggior at yahoo.com
Thu Feb 25 06:32:28 EST 2010


Hello,
good work on checking so soon the Glade source and the line where the '2' digits is hardcoded.

> > Can't the limit be (dynamically) raised by Glade
> >according to the SpinButton 'Digits' field (i.e. a
> >'Digits=6' would allow to insert a more precise upper/lower
> >bound).
> 
> GtkAdjustment is in now way specific to spin button and dynamically
> raising editor's precision based on some widget that simply "consumes"
> adjustment is really not feasible.
> 
> I'm not sure what would the optimal solution be. IMHO,

Sorry, I didn't understand your reply. 
I don't know the Glade code, but (lacking a better solution) I think what I wrote could be feasible. 

I explain myself better. I assume that in Glade there are two 'objects'/data structures  GtkSpinButton and associated GtkAdjustment instantiated for each SpinButton a user creates.  Every time the user modifies the 'Digits' field in the SpinButton, there should be some code/callback in Glade that modifies the allowed number of fractional digits into the associated Adjustment upper/lower/etc attributes.  So that if digits changes from '2' to '6' in that SpinButton, the upper/lower fields would automatically change from  0.00 to 0.000000. 

This, unless you meant there is only one Adjustment kind of 'template' in Glade and once established it as having 2 digits precision it is used by all the other widgets in the Glade editor.

Thanks for help,
Giovanni Maggiorani 





      


More information about the Glade-users mailing list