Al Boldi ha scritto:
Giuliano Colla wrote:
To discover that if your timer event doesn't change something visual,
the smart thing decides that there's nothing important to do, and stays
Idle, so that the OnIdle handler is never called. My kludge has been to
have the Timer update a Label in a hidden corner of the screen, with a
sequence of - \ | / - . This wakes up the main thread, which then goes
Idle, triggers the OnIdle event, and the queue can be processed. You may
see that this is far from satisfactory.
Not sure what you mean? OnTimer does trigger OnIdle even if there is no
visual update. And even if it wouldn't, you could trivially trigger the
OnIdle inside the OnTimer handler yourself.
Can't tell in detail what happens, because I was more interested in the
result than tracing Kylix bugs/deficiencies, and I forgot the details.
I seem to remember that OnIdle is executed just once. Even if the OnIdle
event performs some screen updates, no further OnIdle event is
generated, thus losing whatever happens from that moment on. Triggering
the OnIdle event from Timer in Kylix is not advisable, because it
doesn't appear to be properly protected from reentrancy, and you end up
with a lock. The final result is that if the timer event doesn't change
something visual, the screen isn't updated properly.
Up to now I've not yet tested Lazarus with a real demanding threaded
app, but from what I've read about the OnIdle events from Felipe and
others, I'm afraid that the result won't be much different.
I think it is. Try it.
I hope you're right, because getting rid of kludges is my hope. I'm
anxious to try, but setting up thing in order to test properly is far
from trivial, and requires an amount of time not available right now.
Simpler cases work well under Lazarus, but they worked well under Kylix too.
Giuliano
--
Giuliano Colla
Whenever people agree with me, I always feel I must be wrong (O. Wilde)
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives