gtkD: events being triggered twice

FoxyBrown via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 6 07:58:14 PDT 2017


On Sunday, 6 August 2017 at 09:42:03 UTC, Mike Wey wrote:
> 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.

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.



More information about the Digitalmars-d-learn mailing list