Re: Feedback updating scrollbar



>I fear the problem remains. To stay with your pseudo code: when
>"adjustment_changed_handler" fires, all goes well and we jump to the new
>position in the file. When the file position changes due to, say, passage
>of time, "other_file_position_changed_handler" fires, which eventually
>calls "gtk_adjustment_set_value". Here lies my problem, because
>"gtk_adjustment_set_value" effectively rounds off 'float argument' and
>creates a callback to "adjustment_changed_handler", which changes the
>position again, ever so slightly.

there's no rounding done by the adjustment. however, a 32 bit float
only has 24 bits to hold an integer value with absolute precision.  if
a float value is inadequate to hold the file position precisely (i.e
if it exceeds (2^24)-1 bytes, which is entirely possible), then you're
stuck. maybe you need a custom version of a GtkAdjustment that uses a
32 bit integer (or more generally, off_t) as its value type.

i think.

--p




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