Skip to content

WxWindow

wxWindow is the base class for all windows and represents any visible object on screen.

Size & Position

Window의 크기를 획득하고 싶다면 아래와 같이 사용하면 된다.

wxPoint const FRAME_POSITION = GetPosition(); // You should be called Centre() method.
wxSize const FRAME_SIZE = GetSize();

단, 생성자에서 사용할 경우, GetPosition()의 경우 Centre()를 우선 호출해야 한다.

Invalidate window

This would be the "official" way to force an unconditional redraw and should work.

clientList->Refresh();
clientList->Update();

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.

See also

Favorite site