MacArthur, Ian (SELEX) (UK) wrote: > >> >> I did not test with windows.. will try that a bit later. I >> hate turning >> on my windows box. It's always.. aggravating. > > I tried this on WinXP this morning. Didn't work at first, due to some > oddness in the way the events are received, I think. > > Basically, the handle method sets the class variable "evt" to record the > last event received - this is later tested in dnd_cb() to make sure the > last event was an FL_PASTE when receiving the dropped data. > > Except that on WinXP, by the time the callback runs, the value of "evt" > is always FL_MOVE (not FL_PASTE) - even when I hold the mouse Really > Really Still. > In fact, it really does look as if some move events are received after > the drop event... > > Anyway, bodging the update of "evt" to only update it for events we > "like" (which is probably not a robust thing to do) the code works as > expected. >
Good find! Setting evt in each case makes the most sense I think. The whole point of evt was to allow for the callback to be called immediately after handle() returned. In a perfect world I guess, the FLTK main-loop would handle the timeouts prior to handling any new events. Like you say, this might not be the case in Windows? If you change add_timeout() to add_check() or add_idle() (and add the corresponding remove_check() or remove_idle() in callback_deferred()), does that work? If not, the only solution I can think of is to set evt in each case block. I'll hold back updating the example till we know if either of those work better than a timeout. When I update the example, I will also include making copies of Fl::event() and Fl::event_length() as that is another good suggestion too (by Greg I think). -- Alvin _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

