how to keep a window fix-sized? Topic is solved

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
Post Reply
yunjun
Earned a small fee
Earned a small fee
Posts: 19
Joined: Wed Jan 23, 2008 5:21 pm

how to keep a window fix-sized?

Post 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).
Platform: Windows XP SP2, Visual Studio 2005 Standard
timg
Earned some good credits
Earned some good credits
Posts: 148
Joined: Mon Jan 23, 2006 6:52 pm

Post 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)
yunjun
Earned a small fee
Earned a small fee
Posts: 19
Joined: Wed Jan 23, 2008 5:21 pm

Post by yunjun »

Thanks, it works much better!
I didn't know how to use the 'NOT'('~') sign before.
Platform: Windows XP SP2, Visual Studio 2005 Standard
Post Reply