]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/RichTextCtrl.py
Ensure the old tree item still exists before using it
[wxWidgets.git] / wxPython / demo / RichTextCtrl.py
index f9ceffd44771dcd09f455a692aa58a58648a6ff7..a31dfb41845a0560ed53d039e5eec4d2bd30bd67 100644 (file)
@@ -17,7 +17,7 @@ class RichTextFrame(wx.Frame):
         self.rtc = rt.RichTextCtrl(self, style=wx.VSCROLL|wx.HSCROLL|wx.NO_BORDER);
         wx.CallAfter(self.rtc.SetFocus)
 
-
+        self.rtc.Freeze()
         self.rtc.BeginSuppressUndo()
 
         self.rtc.BeginParagraphSpacing(0, 20)
@@ -172,7 +172,8 @@ class RichTextFrame(wx.Frame):
         self.rtc.EndParagraphSpacing()
 
         self.rtc.EndSuppressUndo()
-
+        self.rtc.Thaw()
+        
 
     def OnFileOpen(self, evt):
         # TODO: Use RichTextBuffer.GetExtWildcard to get the wildcard string
@@ -197,12 +198,13 @@ class RichTextFrame(wx.Frame):
         # TODO: Use RichTextBuffer.GetExtWildcard to get the wildcard string
         dlg = wx.FileDialog(self, "Choose a filename",
                             wildcard="All files (*.*)|*.*",
-                            style=wx.OPEN)
+                            style=wx.SAVE)
         if dlg.ShowModal() == wx.ID_OK:
             path = dlg.GetPath()
             if path:
                 self.rtc.SaveFile(path)
-
+        dlg.Destroy()
+        
                 
     def OnFileViewHTML(self, evt): pass