Page 1 of 1

how to keep a window fix-sized?

Posted: Tue Feb 05, 2008 9:12 pm
by yunjun
Hi, I searched in the documentation for a while but couldn't figure it out. What I currently do is:

Code: Select all

void MainWindow::OnSize(wxSizeEvent &WXUNUSED(event) )
{
	this->SetSize(800,600);
}


BEGIN_EVENT_TABLE(MainWindow, wxFrame)
	EVT_SIZE( MainWindow::OnSize)
END_EVENT_TABLE()
but it obviously isn't a good way and the window flashes too much when I try resizing (even though the size is kept fixed).

Posted: Tue Feb 05, 2008 10:23 pm
by timg
From the manual:

The default frame style is for normal, resizeable frames. To create a frame which can not be resized by user, you may use the following combination of styles: wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BORDER | wxRESIZE_BOX | wxMAXIMIZE_BOX)

Posted: Wed Feb 06, 2008 2:00 pm
by yunjun
Thanks, it works much better!
I didn't know how to use the 'NOT'('~') sign before.