Updating the GUI via code

BlitzMax Forums/Brucey's Modules/Updating the GUI via code

Brucey(Posted 2008) [#1]
Vertex said :

Hi!

I program on a configuration tool. There is a main window and a I click on Menu -> Trial -> Test audio settings should open a new window with a textbox provide as a log.

The problem is, the entries of this log need many seconds like:
"Open audio output driver: OK"
"Make context current: OK"
"Load Test1.wav: OK"
"Play Test1.wav: OK"
"Load Test2.ogg: OK"
"Play Test2.ogg: OK"

And the test audio files need some seconds to play. But in this time I dont know, how I can update the GUI. Today I must wait until all audio files played and than I can show the log.

Is there an alternative to multithreading?



How's about using a wxTimer?
You could set it to fire off an event every second or more, and during the event you can check the status of the test and update parts of the UI as you need.

The samples, timer.bmx and statbar.bmx both use timers. Also wxCodeGen runs a timer to check for file changes.

Or is it something else you are after? :-)


Vertex(Posted 2008) [#2]
Thank you for these answer! For my config tool is a timer enough and a good idea but in general multithreading is needed? And wxWidget cannot handelt as an own thread by self? (On BMax is not possible to work with multithreading but maybe wxWidget can handelt by self)

cu olli