event-handling routines are not called
Posted on 2001-06-18
I'm writing a program, that shows pictures for a user-defined time. That works with
repeat until time_getTime>actual_time+t*1000;
So far everything is okay, but if the user enters -1 the picture should be shown until the user presses a key or clicks the mouse. I tried a similar approach with
repeat until Semaphore;
where Semaphore is a boolean that is set to True in one of two procedures that are connected to the onKeyPress and OnClick events of the component that shows the image. (The routines are connected to the corresponding events of the window as well as to the events of the Image-component.)
My problem is, that these two procedures are not called, and even if I use a special button-window I have to show it as ShowModal. It seems that the empty repeat-until-loop binds all the attention of the system and it has no time to react on the event.
How can I force the events to be handled, is there some other way to wait for an user-caused event like in good old Pascal the "repeat until keypressed"?
Oh, by the way, I'm using Borland Delphi 2.0
Thanks in Advance