MacArthur, Ian (SELEX) (UK) wrote:

> 
> 
>> 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 think setting "evt" only for the events we want is the only way to get
> it to work right on WinXP - or, at the very least we must ignore the
> "spurious" FL_MOVE events that we get after the FL_PASTE occurs.
> 
> Either using add_timeout() or add_check() works pretty much the same on
> WinXP here. I'm not keen on using an idle callback for this, since it
> maxes out the CPU whilst the confirmation dialog is displayed, which is
> a Bad Thing for my money.
> 
> I guess if it works OK everywhere then add_check() is probably the most
> natural way to go.
> 
> In all three cases it only works if "evt" is not allowed to be
> overwritten by FL_MOVE events that occur after the FL_PASTE is received,
> before it is processed.
> 
> 
>> 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).
> 
> Yes - I've been using Greg's modified version of the code. The previous
> version does not work at all on OSX, so it needs the copy of event_text
> and event_length to work.
> 

Sounds good. I will update the article to use add_check(). The only reason I
went with add_timeout() was that it does not require it to be explicitly
removed once it is done.

Thanks for testing on Windows.

Alvin
-- 
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to