GNOME Bugzilla – Bug 88277
add subrange markers to scale widgets
Last modified: 2010-06-27 23:56:28 UTC
Some applications would benefit if hscale and vscale featured a couple of markers to let the user delimit a subrange. Think of cue points, A-B points, loop delimiters, etc. in an audio sample or video sequence. Or picking a range of pages to print while previewing them. The feature could be made broader and added to range widgets in general, but I think that such idea makes less sense. I've never dealt with Gtk+ before, but from a first quick look I gather that this would require not only changes in gtk(h/v)scale.c and gtkrange.c (or subclassing), but also changes in the theme engines. It's tempting to just write a private widget, but on the other hand that probably wouldn't fit the user's theme and would be harder to reuse in other applications. Gtk+ already supports widgets that are arguably of less common use, like gamma curves.
Heh, "GTK+ has Gamma curves" is more likely to discourage us than encourage us for adding new features ... we recognize our past mistakes :-) The GTK+ theme system is actually design with custom widgets in mind, though there are certainly potential problems ... instead of having a "draw the range widget" call, there are separate calls for different parts of a widget. Do other modern toolkits (MS WinForms, Qt, Swing) have this feature?
As far as I know, no mainstream toolkit offers this feature out of the box. One could ipso facto argue that maybe it isn't THAT useful, but playing the devil's advocate I'll say that possibly that's because developers, when not using a custom widget, have traditionally settled with awkward alternatives to select a subrange. Just because nobody offers a standard way to select a subrange doesn't mean it's not a good idea to do it. Several categories of programs need it (music sequencers, animators, etc.) while others could benefit too, improving the user interface: compared to a couple of spin buttons you get greater visual feedback, which in some cases might make a major difference. Maybe a better implementation would be to offer a new subrange widget and a new composite widget that groups together a scale and a subrange. By virtue of Fitts' law this would be more usable, as the targets would be larger. The subrange widget could be useful also for other non-obvious applications, for example interactive queries. This is hardly anything new, as seen in the work of Ben Shneiderman and UoMD's HCIL - check the 2nd, 3rd and 4th screenshot: http://www.cs.umd.edu/hcil/spotfire/ The composite widget could be less of a priority, even optional, as long as there's some easy way for the developer to align a scale and a subrange (any given value in the range should have the same X coordinate in both widgets in a horizontal layout and same Y in a vertical layout). This is a feature that I need by hook or by crook. I can do things by scratch on my own (dunno if I'll be able to release the sources then) or I can contribute the code to GTK+ - hopefully somebody with a better knowledge of the toolkit's internals can point to the least invasive way to proceed.
We added something like this a while ago, so closing this