On 27.03.2011 11:09, chris wrote: >> as said before, it is not useful to check if an event is inside the >> window that got the event, because this is always true (to be precise: >> this *may* be false for FL_DRAW, FL_DRAG and maybe DND events, but >> this is a special case). > > Actually it was this special case I originally stumbled over, when trying to > check if a DND event ended within a subwin...
Oh, I see. That is an interesting question. Well, if this is a DND event that originates from another window, then it is clear that you only get the event when the mouse is inside the window that handle()s it. I'm not so sure if the DND drag was started inside the same FLTK window, though, but I /believe/ that it is the same. The easiest way to solve this would be to use groups and not subwindows, though. >> So, yes, I changed the docs to make it clear that >> Fl::event_inside(const Fl_Widget *) must not be called for the >> window that handles the event. Thanks for the report. >> > > Thanks for confirming and for the detailed explanations. You're welcome. > BTW: I also tried experimentally to change the Fl::event_inside(const char*) > method within FLTK to my version, but it seemed not to fix the problem. I > guess FLTK's event handling itself relies on how it is currently implemented. Yes, sure, and there are some optimizations and of course special handling of subwindows WRT coordinate transformation. Otherwise we could maybe change the internal method, but this would require some more (recursive) coordinate transformations. The way it is, it is intended and used to dispatch events to /child/ widgets of a particular window or group, and that is how it works. Sidenote: if an event is delivered to a subwindow, the coordinates are adjusted to be relative to this window, even if the event was originally delivered to the main window, and that's what you can see also in your example code. Albrecht _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

