digitalmars.D.learn - gtkD: events being triggered twice
- Johnson Jones (22/22) Aug 05 2017 GtkEventBox - Enter
- Mike Wey (4/34) Aug 06 2017 Do you have an more complete example that i could test.
- FoxyBrown (12/45) Aug 06 2017 I don't really(my code is a bit more complex) but basically all
- Mike Wey (6/20) Aug 06 2017 To test i put the label that is on the label page in an event box but
- FoxyBrown (29/50) Aug 06 2017 Ok, I will try to work on figuring out what is going and and
- Adam D. Ruppe (4/6) Aug 07 2017 I don't know gtk, but I would suspect moving the mouse over the
- Johnson Jones (8/14) Aug 07 2017 Yeah, but both those events are from EventBox. If that were true
- Mike Wey (4/60) Aug 07 2017 Also seems to be working properly with a Separator.
- Johnson Jones (6/9) Aug 07 2017 Ok, I guess it's on my end, I don't see how since I'm not doing a
GtkEventBox - Enter GtkEventBox - Enter Down GtkEventBox - Leave Up GtkEventBox - Leave GtkEventBox - Leave That is when I move the mouse over the event box then click then move out out then release. I would expect Enter Down Leave Up The fact that enter and leave are not paired equally is a problem. Can be worked around but seems like it would be a bug. the code is simply ebox.addOnEnterNotify(delegate(Event e, Widget w) { writeln(w.getName(), " - ", "Enter"); return true; }); ebox.addOnLeaveNotify((Event e, Widget w) { writeln(w.getName(), " - ", "Leave"); return true; });
Aug 05 2017
On 06-08-17 03:25, Johnson Jones wrote:GtkEventBox - Enter GtkEventBox - Enter Down GtkEventBox - Leave Up GtkEventBox - Leave GtkEventBox - Leave That is when I move the mouse over the event box then click then move out out then release. I would expect Enter Down Leave Up The fact that enter and leave are not paired equally is a problem. Can be worked around but seems like it would be a bug. the code is simply ebox.addOnEnterNotify(delegate(Event e, Widget w) { writeln(w.getName(), " - ", "Enter"); return true; }); ebox.addOnLeaveNotify((Event e, Widget w) { writeln(w.getName(), " - ", "Leave"); return true; });Do you have an more complete example that i could test. -- Mike Wey
Aug 06 2017
On Sunday, 6 August 2017 at 09:42:03 UTC, Mike Wey wrote:On 06-08-17 03:25, Johnson Jones wrote:I don't really(my code is a bit more complex) but basically all it boils down to is a UI with some nested widgets (an overlay, an box, and a box and one contains the eventbox which I added those callbacks on. I think that something like https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/TestWindow/TestWindow.d should probably work by just adding an eventbox somewhere and adding that code above. If it doesn't exhibit the same behavior then it has something to do with my project and I could try to reduce it to a minimal example.GtkEventBox - Enter GtkEventBox - Enter Down GtkEventBox - Leave Up GtkEventBox - Leave GtkEventBox - Leave That is when I move the mouse over the event box then click then move out out then release. I would expect Enter Down Leave Up The fact that enter and leave are not paired equally is a problem. Can be worked around but seems like it would be a bug. the code is simply ebox.addOnEnterNotify(delegate(Event e, Widget w) { writeln(w.getName(), " - ", "Enter"); return true; }); ebox.addOnLeaveNotify((Event e, Widget w) { writeln(w.getName(), " - ", "Leave"); return true; });Do you have an more complete example that i could test.
Aug 06 2017
On 06-08-17 16:58, FoxyBrown wrote:I don't really(my code is a bit more complex) but basically all it boils down to is a UI with some nested widgets (an overlay, an box, and a box and one contains the eventbox which I added those callbacks on. I think that something like https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/Tes Window/TestWindow.d should probably work by just adding an eventbox somewhere and adding that code above. If it doesn't exhibit the same behavior then it has something to do with my project and I could try to reduce it to a minimal example.To test i put the label that is on the label page in an event box but that doesn't reproduce the issue. I get just a single event on enter and a single event on leave. -- Mike Wey
Aug 06 2017
On Sunday, 6 August 2017 at 18:26:20 UTC, Mike Wey wrote:On 06-08-17 16:58, FoxyBrown wrote:Ok, I will try to work on figuring out what is going and and potentially reduce to a test case. It might be on my end. I'm pretty sure I'm not adding You might try a separator though in the event box and might try to add it handling various events(maybe even other events for the event box)... things related to the mouse. Here's the glade code for the event box I'm using <object class="GtkEventBox" id="MainSeparator"> <property name="height_request">5</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="above_child">True</property> <child> <object class="GtkSeparator"> <property name="height_request">5</property> <property name="visible">True</property> <property name="sensitive">False</property> <property name="can_focus">False</property> <property name="events"/> <property name="orientation">vertical</property> </object> </child> </object> Try that when you get some time and see if that changes anything. If it doesn't then it's surely in my code or in the gtk version I'm using(still using msys, I'll update to what you released to see if that fixes it). At least we can narrow it down a little...I don't really(my code is a bit more complex) but basically all it boils down to is a UI with some nested widgets (an overlay, an box, and a box and one contains the eventbox which I added those callbacks on. I think that something like https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/TestWindow/TestWindow.d should probably work by just adding an eventbox somewhere and adding that code above. If it doesn't exhibit the same behavior then it has something to do with my project and I could try to reduce it to a minimal example.To test i put the label that is on the label page in an event box but that doesn't reproduce the issue. I get just a single event on enter and a single event on leave.
Aug 06 2017
On Sunday, 6 August 2017 at 19:27:15 UTC, FoxyBrown wrote:<child> <object class="GtkSeparator">I don't know gtk, but I would suspect moving the mouse over the child triggers the enter/leave notifications too and it bubbles up to the parent.
Aug 07 2017
On Monday, 7 August 2017 at 16:13:18 UTC, Adam D. Ruppe wrote:On Sunday, 6 August 2017 at 19:27:15 UTC, FoxyBrown wrote:Yeah, but both those events are from EventBox. If that were true I'd except Separator to be shown as the widget that has the event. I do return true from the handler which I believe is suppose to stop any more handlers. Although, it does sound something like what you are saying... but it also doesn't explain why the events are not paired, which is the more serious issue.<child> <object class="GtkSeparator">I don't know gtk, but I would suspect moving the mouse over the child triggers the enter/leave notifications too and it bubbles up to the parent.
Aug 07 2017
On 06-08-17 21:27, FoxyBrown wrote:On Sunday, 6 August 2017 at 18:26:20 UTC, Mike Wey wrote:Also seems to be working properly with a Separator. -- Mike WeyOn 06-08-17 16:58, FoxyBrown wrote:Ok, I will try to work on figuring out what is going and and potentially reduce to a test case. It might be on my end. I'm pretty sure I'm not adding You might try a separator though in the event box and might try to add it handling various events(maybe even other events for the event box)... things related to the mouse. Here's the glade code for the event box I'm using <object class="GtkEventBox" id="MainSeparator"> <property name="height_request">5</property> <property name="visible">True</property> <property name="can_focus">False</property> <property name="above_child">True</property> <child> <object class="GtkSeparator"> <property name="height_request">5</property> <property name="visible">True</property> <property name="sensitive">False</property> <property name="can_focus">False</property> <property name="events"/> <property name="orientation">vertical</property> </object> </child> </object> Try that when you get some time and see if that changes anything. If it doesn't then it's surely in my code or in the gtk version I'm using(still using msys, I'll update to what you released to see if that fixes it). At least we can narrow it down a little...I don't really(my code is a bit more complex) but basically all it boils down to is a UI with some nested widgets (an overlay, an box, and a box and one contains the eventbox which I added those callbacks on. I think that something like https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/Tes Window/TestWindow.d should probably work by just adding an eventbox somewhere and adding that code above. If it doesn't exhibit the same behavior then it has something to do with my project and I could try to reduce it to a minimal example.To test i put the label that is on the label page in an event box but that doesn't reproduce the issue. I get just a single event on enter and a single event on leave.
Aug 07 2017
On Monday, 7 August 2017 at 21:01:33 UTC, Mike Wey wrote:On 06-08-17 21:27, FoxyBrown wrote:Ok, I guess it's on my end, I don't see how since I'm not doing a hell of a lot and only gtk is calling those event handlers, I'll try to create a test app at some point. I've already added logic to prevent multiple reentries though so, for now I've solved the problem.[...]Also seems to be working properly with a Separator.
Aug 07 2017