X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0cebbfc2bd3a22ee50f789fca623d9037660e495..8145496b9bd1cbccf7411c5e76f72a9dfc7ebf1b:/samples/widgets/widgets.cpp diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index 4c16ebb83c..fde4f53272 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -637,6 +637,8 @@ void WidgetsFrame::OnPageChanging(WidgetsBookCtrlEvent& event) // don't allow selection of entries without pages (categories) if ( !m_book->GetPage(event.GetSelection()) ) event.Veto(); +#else + wxUnusedVar(event); #endif } @@ -651,12 +653,16 @@ void WidgetsFrame::OnPageChanged(WidgetsBookCtrlEvent& event) GetMenuBar()->Check(Widgets_BusyCursor, false); - // lazy creation of the pages + // create the pages on demand, otherwise the sample startup is too slow as + // it creates hundreds of controls WidgetsPage *page = CurrentPage(); if ( page->GetChildren().empty() ) { wxWindowUpdateLocker noUpdates(page); page->CreateContent(); + //page->Layout(); + page->GetSizer()->Fit(page); + WidgetsBookCtrl *book = wxStaticCast(page->GetParent(), WidgetsBookCtrl); wxSize size; for ( size_t i = 0; i < book->GetPageCount(); ++i )