Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / BlueGUI problem - setGadgetText disables buttons

Author
Message
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 16th Jul 2005 06:04 Edited at: 16th Jul 2005 06:04
Hi

I made this small example to show you what my problem is:



In this program the "Exit"-button won't work, neither can you exit by pressing the X in the corner.
However :



this program works. I only removed the "SetGadgetText" from the loop.
Can anyone help me?

Thanks

KLU 007

*** PANZERGAMES ***
Rob K
Retired Moderator
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Surrey, United Kingdom
Posted: 16th Jul 2005 06:15
Hi Klu,

Your program is overloading the event queue. Every time you call setGadgetText (in this case that means every single loop!), a message is sent to the window which then processes it and updates.

Since only one event is removed from the queue each time getEvent is called, other events therefore get crowded out.

One solution would be to put a call to flushEvents after setGadgetText, but a much better option would be to only call setGadgetText when there is a change (check the current text using getGadgetText).


BlueGUI Windows Plugin
Freddy 007
19
Years of Service
User Offline
Joined: 30th Nov 2004
Location: Denmark
Posted: 16th Jul 2005 07:07
Ahh, that helps a lot!
After hours of struggling, I can finally move on with my project
Thank you

*** PANZERGAMES ***

Login to post a reply

Server time is: 2024-04-20 13:21:08
Your offset time is: 2024-04-20 13:21:08