If you use a GtkEventBox
and add an event,
say GDK_BUTTON_MOTION_MASK
via gtk_widget_add_events
,
how can we delete this event from the event box again?
Asked
Active
Viewed 119 times
0

onemorequestion
- 1,056
- 1
- 10
- 15
-
1With [gtk_widget_set_events](https://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-set-events). But I am strongly suggesting you to be carefully with this function, because you need to set all needed masks yourself. All other are gone once’s that you call it. – Michi Jul 29 '20 at 06:22
-
Create a temporary MASK with gtk_widget_get_events and later call the set_events on this mask to put back those events you had before GDK_BUTTON_MOTION_MASK was set. – Michi Jul 29 '20 at 06:27
-
I tried this already, but doesn't work. The `get` function delivers the mask as an Int (0 for my new created event box). After setting `GDK_BUTTON_MOTION_MASK` I got 16 back as Int for the bit MASK. If I try to set it back to 0 with `set` function and call thereafter again `get` the bit mask is still on 16. ??? – onemorequestion Jul 29 '20 at 07:21
-
[how to reset a bit](https://stackoverflow.com/a/47990/4226702) – Alexander Dmitriev Jul 29 '20 at 07:30
-
@Michi If I have to do this after the widget is realized already, do I have to unrealize the widget before? Or is there another way, even if the docs say exact to have to do this? I would accept your comment as an answer, if you leave a hint, that the widget have to be unrealized again, if there is no other way. THX. – onemorequestion Aug 09 '20 at 09:50