From 119629aa5d35ae594f911f8f430d903eeeea96c3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 22 May 2010 11:58:50 +0000 Subject: [PATCH] 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 --- samples/notebook/notebook.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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() -- 2.45.2