Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GtkScale gets no "released" signal using a GtkGestureClick #77

Open
jonathanBieler opened this issue Oct 23, 2024 · 0 comments
Open

GtkScale gets no "released" signal using a GtkGestureClick #77

jonathanBieler opened this issue Oct 23, 2024 · 0 comments
Labels
upstream Probably caused by a bug in one of the C libraries wrapped by a package

Comments

@jonathanBieler
Copy link

I'm not totally sure that's a bug or by design but I write this here for reference.

if you try to get a signal for releasing a click on a scale, it doesn't work :

using Gtk4

c = GtkScale(:h, 0, 1, 0.01)
win = GtkWindow(c, "Scale")

g = GtkGestureClick(c, 0)
signal_connect(g, "released") do controller, n_press, x, y
    @info "released"
end
signal_connect(g, "pressed") do controller, n_press, x, y
    @info "pressed"
end

Apparently there was a bug related to this but it should be fixed already in the JLL we use.

https://gitlab.gnome.org/GNOME/gtk/-/issues/4939

Searching a bit I came across this workaround (wrap the scale in a box), that works just fine :

using Gtk4
c = GtkScale(:h,0,1, 0.01)
box = GtkBox(:v)
push!(box,c)

win = GtkWindow(box, "Scale")

g = GtkGestureClick(box, 0)
Gtk4.G_.set_propagation_phase(g, Gtk4.PropagationPhase_CAPTURE)

signal_connect(g, "released") do controller, n_press, x, y
    @info "released"
end
signal_connect(g, "pressed") do controller, n_press, x, y
    @info "pressed"
end

gircore/gir.core#1015 (comment)

@jwahlstrand jwahlstrand added the upstream Probably caused by a bug in one of the C libraries wrapped by a package label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Probably caused by a bug in one of the C libraries wrapped by a package
Projects
None yet
Development

No branches or pull requests

2 participants