Re: Problem with precision on GtkAdjustment



Maybe it's the digits-clamping - if you have only 1 digit precision,
it rounds off to .1, .2, etc., try gtk_scale_set_digits()? If not
that, no idea.

So that function actually rounds off the *value*, it doesn't just affect
display? I don't even have display of the value turned on---I'm printing
the value out in the adjustment_changed callback. Well, I will try it
and see what happens. 

We changed GtkAdjustment to contain doubles in GTK 2, but your problem
seems larger scale than that, float's loss of precision would be more
subtle.

Yes. I will let you know about scale_set_digits, and failing that, I
would suspect that there's a problem in the Scale class, in whichever
section computes the increment that's used for dragging. (That increment
seems to depend on the size of the Scale widget, too.) I'll start
looking through the source code for this (my searching for instances of
step_increment may have been a red herring, since the problem is with
the on-the-fly-computed drag increment and not step_increment.) 

-- 
@@@ david o'toole
@@@ dto gnu org
@@@ www.gnu.org/software/octal





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]