Re: ? re: Win32lib an onClick (+fan mail)
- Posted by Brian Broker <bkb at CNW.COM> Feb 16, 2000
- 649 views
On Tue, 15 Feb 2000 22:22:10 -0800, Dan B Moyer wrote: >Hi Sherm, > >I guess there must be some reason this won't work, or someone would have >suggested it, but here's what I would have tried: > >Make an integer variable to serve as a true/false flag, >("Flag_StopDisplay"), & initialize it to 0; make a procedure to respond to >the "stop" button click event that sets the flag to 1; put a test for that >flag in your while loop, with "exit" if the flag = 1 (with reset the flag to >0 before the exit command). > >I guess it wouldn't stop your BMP display in the middle of putting up a >specific picture, but I would think it would stop at the beginning or end of >one, and they're small enough that that might be serviceable?? From past experience... I think the problem with that solution is that your button click does not get processed until you finish the loop that displays your bitmaps. (I think that was the original problem that started this thread.) When your loop finishes, then your button gets processed, but then it's too late. That's why a timer is required... it gives you the break required to process that button click. Unfortunately, you can't get much speed using a regular timer. Multimedia timers are supposedly much faster but I haven't looked into them in depth. -- Brian