Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

GtkScale ignores range step size #659

Open
yakir12 opened this issue Aug 8, 2022 · 3 comments
Open

GtkScale ignores range step size #659

yakir12 opened this issue Aug 8, 2022 · 3 comments

Comments

@yakir12
Copy link
Contributor

yakir12 commented Aug 8, 2022

The scale/slider in the following MWE ignores the size of the step of the range:

using Gtk
win = GtkWindow("My First Gtk.jl Program", 400, 200)
b = GtkScale(false, 1:2:11)
push!(win,b)
showall(win)

It behaves identically to

...
b = GtkScale(false, 1:11)
...
@tknopp
Copy link
Collaborator

tknopp commented Aug 8, 2022

From:
https://docs.gtk.org/gtk3/ctor.Scale.new_with_range.html

"step must be nonzero; it’s the distance the slider moves when using the arrow keys to adjust the scale value."

I would have expected something different as well but it works like it is documented.

@yakir12
Copy link
Contributor Author

yakir12 commented Aug 8, 2022

Fair enough but horrible. The values the slider outputs should/must be members of the range/set it got as input, not to mention that they aught to match what you get if you use the mouse versus the keyboard (albeit can be different if you use the arrows with a modifier key). I can work around this, but it caught me by surprise. Maybe we should add a note box to the docs and warn users about it.

@tknopp
Copy link
Collaborator

tknopp commented Aug 8, 2022

I think the actual increment can be set when first creating a GtkAdjustment and use that to create the GtkScale. I usually do this within Glade.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants