From: Vadim Zeitlin Date: Sat, 22 May 2010 11:58:50 +0000 (+0000) Subject: Correct notebook sample layout. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/119629aa5d35ae594f911f8f430d903eeeea96c3?hp=ade4ae2c51fd5406a8d7bbebc36ccd2c94e48c59 Correct notebook sample layout. Use a sizer for the frame to make sure its initial and minimal size correspond to the best size of the panel inside it. Also add a Layout() call on the panel which was somehow not done initially. And finally don't centre the frame, this is unnecessary. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index bfd3962a9d..1baf0c503c 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -402,10 +402,11 @@ MyFrame::MyFrame() RecreateBook(); m_panel->SetSizer(m_sizerFrame); + m_panel->Layout(); - m_sizerFrame->SetSizeHints(this); - - Centre(wxBOTH); + wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); + sizer->Add(m_panel, wxSizerFlags(1).Expand()); + SetSizerAndFit(sizer); } MyFrame::~MyFrame()