40761RE: [libertybasic] menu halts program
- May 1, 2010
>Instead of using a loop you can use a TIMER to update the graph.
> This is the second time I've tried to post this query. It
> didn't seem to appear, so apologies if it does appear twice.
> I have a continuous graphing program which has a a menu bar.
> The main loop of the program is something like:
> Loop until 1=0
> When the menu is accessed (or in fact, any windows dialogue
> box like FILEDIALOG is brought up) the program halts the loop
> until the menu is closed again, then the loop continues.
> Has anyone else experienced this? Is this a limitation of
> LB, or is there some workaround?
> Many thanks,
The basic structure would be:
' first turn timer off, so we can do our work without getting interrupted
TIMER 100, [StartTimerLoop]
The advantage is, that you can turn off the constant update of the graph from anywhere in your program by issuing a "TIMER 0"
To have the update of the graph being fully independent from the GUI user interaction, one would have to create a separate thread
for the graph update procedure, but this currently not possible with LB.
Liberty BASIC Assist 4.03 ........ http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 RC2 ........... http://www.libertybasic.com/lb404setup.exe
Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC
Windows 7 Home Premium 64-bit RTM
AMD Turion X2 RM-70 2GHz, 4GB RAM
- << Previous post in topic Next post in topic >>