gpredict icon indicating copy to clipboard operation
gpredict copied to clipboard

mouse scroll wheel not working

Open n4ogw opened this issue 1 year ago • 1 comments

The mouse scroll wheel isn't working to adjust the frequency or rotator position. To receive mouse wheel events one needs to enable the #GDK_SCROLL_MASK mask.


diff --git a/src/gtk-freq-knob.c b/src/gtk-freq-knob.c
index 9225acc..cab21de 100644
--- a/src/gtk-freq-knob.c
+++ b/src/gtk-freq-knob.c
@@ -358,6 +358,7 @@ GtkWidget      *gtk_freq_knob_new(gdouble val, gboolean buttons)
             g_signal_connect(knob->evtbox[i],
                              "button_press_event", (GCallback) on_button_press,
                              widget);
+           gtk_widget_add_events(GTK_WIDGET(knob->evtbox[i]), GDK_SCROLL_MASK);
             g_signal_connect(knob->evtbox[i], "scroll_event",
                              (GCallback) on_button_scroll, widget);
 

diff --git a/src/gtk-rot-knob.c b/src/gtk-rot-knob.c
index a7d0771..25f52cd 100644
--- a/src/gtk-rot-knob.c
+++ b/src/gtk-rot-knob.c
@@ -528,6 +528,7 @@ GtkWidget      *gtk_rot_knob_new(gdouble min, gdouble max, gdouble val)
 
         g_signal_connect(knob->evtbox[i], "button_press_event",
                          (GCallback) on_button_press, widget);
+       gtk_widget_add_events(GTK_WIDGET(knob->evtbox[i]), GDK_SCROLL_MASK);
         g_signal_connect(knob->evtbox[i], "scroll_event",
                          (GCallback) on_button_scroll, widget);
 

n4ogw avatar Jul 08 '24 15:07 n4ogw

I will include this enhancement, thanks!

csete avatar Sep 17 '24 20:09 csete