GNOME Bugzilla – Bug 97326
need access to gtk_range_calc_layout()
Last modified: 2013-02-04 02:13:07 UTC
To implement a custom scale widget one would derive from GtkScale or GtkRange. If one wants to override the expose method implemented in GtkRange one needs access to gtk_range_calc_layout(). This is because the GtkRange implementation delays all calculations by setting range->need_recalc and calls gtk_range_calc_layout() from the expose method. To make it possible to implement a different look, derived widgets need to be able to trigger the recalculation so they can draw the UI elements into the correct locations.
I think that deriving from these widgets really is something we don't want to encourage ... it greatly constrains the changes we can make to internal implementation details, and thus, the extent we can improve or fix the widgets.
You are probably right that deriving from GtkRange shouldn't be encouraged. There are situations however where it makes sense. We can live with the ugly hack we used for the GimpColorScale implementation (I'll attach a screenshot) but of course we'd prefer a better solution. It's up to you...
Created attachment 11939 [details] screenshot of our derived scale widget