]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/widgets.cpp
changes wxDirExists() to accept wxString instead of wxChar*, so that it can be used...
[wxWidgets.git] / samples / widgets / widgets.cpp
index 510cdbc6589f8a01aaf52bc97daeb95f5c02865d..fde4f53272f909bfbd6681742eb2ff4b139416a9 100644 (file)
@@ -653,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 )