]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/textctrl.cpp
fix for potential crash when conversion fails
[wxWidgets.git] / samples / widgets / textctrl.cpp
index 87bf0c0cfa1b6120b3a75f0122a4399b75c891b2..0d2e8e293c966b098b2a8e8e08193f0d74d9e64d 100644 (file)
@@ -138,6 +138,9 @@ public:
     virtual wxControl *GetWidget() const { return m_text; }
     virtual void RecreateWidget() { CreateText(); }
 
+    // lazy creation of the content
+    virtual void CreateContent();
+
 protected:
     // create an info text contorl
     wxTextCtrl *CreateInfoText();
@@ -374,7 +377,10 @@ TextWidgetsPage::TextWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist)
     m_posLast =
     m_selFrom =
     m_selTo = -2; // not -1 which means "no selection"
+}
 
+void TextWidgetsPage::CreateContent()
+{
     // left pane
     static const wxString modes[] =
     {