Motif scrollbar patch attempt



Hello,

I'm trying to patch gtk scrollbars to work like the Motif ones (that is,
button 2 moves directly to the clicked spot; try it in Netscape for
instance) and I'm stuck.

It appears as though it would be quite easy, but I need to translate the
xy position clicked to an adjustment value. Now there is a dummy function
gtk_range_calc_value that, by the sound of it, would do this. Two problems
though. First, the value of the adjustment depends on the type of
scrollbar, thus a subclass of gtkrange. Second, gtk_range_calc_value takes
only one gint parameter position (beats me what that means) instead of x
and y.

So the way I see it I have to add a new abstract method to GtkRange
(gfloat gtk_range_calc_value(GtkRange *range, gint x, gint y)) and leave
it up to subclasses to define it. 

Is there a better way? I can't seem to find one. Everything seems to boil
down to setting the correct adjustment value without knowing anything
about the type of scrollbar. 

-----------------------------------------------------------------------
Per Lewau (perle@lysator.liu.se)Student of Computer Science at the 
				University of Linkoping, 
				Sweden. 
"Why waste time learning, when ignorance is instantaneous?"
						- Hobbes



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