I'm trying to get a horizontal scale with
- origin on the left
- cursor keys left/right = decrease/increase
- cursor keys up/down = increase/decrease (and the same for pageup/pagedown/end/home)
setInverted(true) doesn't help much because then I get the origin to the right. Would I have to intercept/override some key events to do this?
import std.stdio;
import gtk.Main;
import gtk.MainWindow;
import gtk.Box;
import gtk.Scale;
void main(string[] args)
{
Main.init(args);
MainWindow window = new MainWindow("title");
window.setSizeRequest(400, 200);
Box box = new Box(Orientation.VERTICAL, 5);
{
// ✓ origin left
// ✓ left/right cursor keys
// ✕ up/down cursor keys
Scale scale1 = new Scale(GtkOrientation.HORIZONTAL, 0, 100, 10);
box.add(scale1);
// ✕ origin left
// ✓ left/right cursor keys
// ✓ up/down cursor keys
Scale scale2 = new Scale(GtkOrientation.HORIZONTAL, 0, 100, 10);
scale2.setInverted(true);
box.add(scale2);
}
window.add(box);
window.showAll();
Main.run();
}