Hi everybody...
my issue is the speed the GUI draws some text on the screen.
I wrote a tiny progress dialog with a simple gauge and some text on it. The frame is derived from wxDialog and is brought to screen via Show() in the ctor. Perfect so far. But when I create the dialog the gauge runs fine but the text is not drawn at all. To avoid this, I added a wxSleep(1) at the end of the ctor and that works. But that couldn't be the right way, could it?
Is there a function like wxWaitRedraw() or something like that? Waiting a second for the GUI to draw some text hurts!
Thanks for your hints
Chris
[wxWindows 2.4.2/vc7 2003/WinXP]
How to speed up GUI redraw?
- Ryan Norton
- wxWorld Domination!
- Posts: 1319
- Joined: Mon Aug 30, 2004 6:01 pm
Re: How to speed up GUI redraw?
Are you overloading the paint event or are you using a wxClientDC to draw on the window?BBSnowman wrote:Hi everybody...
my issue is the speed the GUI draws some text on the screen.
I wrote a tiny progress dialog with a simple gauge and some text on it. The frame is derived from wxDialog and is brought to screen via Show() in the ctor. Perfect so far. But when I create the dialog the gauge runs fine but the text is not drawn at all. To avoid this, I added a wxSleep(1) at the end of the ctor and that works. But that couldn't be the right way, could it?
Is there a function like wxWaitRedraw() or something like that? Waiting a second for the GUI to draw some text hurts!
Thanks for your hints
Chris
[wxWindows 2.4.2/vc7 2003/WinXP]
If doing the former, are you double-buffering it?
[Mostly retired moderator, still check in to clean up some stuff]
How do you handle drawing the guage vs. the text? If the text doesn't draw at all and a sleep solves the problem it sounds to me like your progress bar update function is blocking the main event loop (although I still wouldn't now why it wouldn't draw at all, but I don't know exactly what you're doing, so it's rather difficult to tell), so you may want to try updating the progress bar on idle events (one step at a time, don't block it!) or something like that (Yield might work too).