// don't allow selection of entries without pages (categories)
if ( !m_book->GetPage(event.GetSelection()) )
event.Veto();
+#else
+ wxUnusedVar(event);
#endif
}
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 )