WxWindow
lastmod 2018-08-17created 2014-11-097 edits
wxWindow is the base class for all windows and represents any visible object on screen.
Size & Position
To get the size of a window, use it as follows.
wxPoint const FRAME_POSITION = GetPosition(); // You should be called Centre() method.
wxSize const FRAME_SIZE = GetSize();
However, when used in the constructor, Centre() must be called first for GetPosition().
Invalidate window
This would be the "official" way to force an unconditional redraw and should work.
Refresh() vs Update()
Update will only immediately repaint invalidated areas, whereas Refresh
tells wxWidgets you want the entire window redrawn (but won't do so until
idle time). If you want to repaint the entire window *now* you would use:
Refresh();
Update();
But if it was OK to repaint the entire window the next time there's idle
time, you could use just Refresh();
If the job will finish quickly, you can use wxYield or one if its brothers
to give other events (most importantly repaints) a chance to run. If it's a
longer job, running several seconds, you may want to consider a thread.