Re: Waiting in a loop



Hey Matt,

There is a function for this that passes control out of the
while loop. I can't remember the name now but it is part of
the GUI tools. If you hunt around in that part of the
manual for a while you should find it.

ed





"Matt " <keebler303@xxxxxxxxx> wrote in message
<ff09ab$jkr$1@xxxxxxxxxxxxxxxxxx>...
I have written a gui program to send data to external
hardware. Around 15000 values are sent to the hardware.
The
buffer is around 500 values. It takes around an hour to
send all the data as the buffer is gradually read and
emptied by the external hardware. I have a while loop
setup
so that it will wait until the buffer has space before
sending more data. While it is waiting, it ties up the
processor almost completely. Sometimes, I want to cancel
the routine by clicking a cancel button in the gui. The
mouse is delayed and jumpy and there is some delay when I
click the button. How can I setup my waiting routine so
that the processor is not bogged down in this while loop
waiting to send another chunk of data? I want to free up
the processor when the buffer is full instead of tying it
down in a while loop.

Thanks
Matt

.



Relevant Pages

  • Re: Splash Screens , how could something so basic still be hard?
    ... of dealing with splash screens, and I was merely seeking to show that ... or Windows GUI group, I think that's a reasonable expectation. ... Hooking in, of course, assumes that you have some sort of main loop ... GTK, for example, everything is a signal. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Splash Screens , how could something so basic still be hard?
    ... You say that there "is no message pump to allow for further GUI ... Note that by "there is no message pump", I mean that because of the way the code is written, no message pump is working while the "splash screen" is displayed. ... In a normal Forms app, there would be a message pump loop, and there's no reason to believe that in those examples, one doesn't exist. ... The same technique is possible in Windows, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: wxPython fast and slow
    ... CallAfter is intended to queue up a delayed call (via the GUI queue), ... The loop ran quickly and the GUI remained responsive during the loop. ... If you want to take over the primary dispatch loop for the application, ...
    (comp.lang.python)
  • Re: Continuous loop handling
    ... > monitor the hardware input in a while loop. ... Tough my gui is active by this ... Is there a way to free up the cpu time ... Sleep somewhere inside your loop. ...
    (microsoft.public.vc.mfc)
  • Re: Win32::GUI and Scrolling Text
    ... else sleep again and repeat. ... It then loops back and starts reading where it left off (if there are ... I don't need this "event handler loop" stuff getting in my way. ... Can I just do a fork and say "Here Mr. TK GUI, ...
    (comp.lang.perl.misc)