TextViewer.py
changeset 116 58b9b84e385f
parent 113 9eeaebd867aa
child 121 40b91ba978db
--- a/TextViewer.py	Wed Oct 24 17:40:04 2007 +0200
+++ b/TextViewer.py	Fri Oct 26 10:25:01 2007 +0200
@@ -153,7 +153,7 @@
         self.SetModEventMask(wx.stc.STC_MOD_BEFOREINSERT|wx.stc.STC_MOD_BEFOREDELETE)
 
         self.Bind(wx.stc.EVT_STC_STYLENEEDED, self.OnStyleNeeded, id=ID_TEXTVIEWER)
-        if window and controler:
+        if controler:
             self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
             self.Bind(wx.stc.EVT_STC_DO_DROP, self.OnDoDrop, id=ID_TEXTVIEWER)
             self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
@@ -217,13 +217,15 @@
     # Buffer the last model state
     def RefreshBuffer(self):
         self.Controler.BufferProject()
-        self.ParentWindow.RefreshTitle()
-        self.ParentWindow.RefreshEditMenu()
+        if self.ParentWindow:
+            self.ParentWindow.RefreshTitle()
+            self.ParentWindow.RefreshEditMenu()
     
     def StartBuffering(self):
         self.Controler.StartBuffering()
-        self.ParentWindow.RefreshTitle()
-        self.ParentWindow.RefreshEditMenu()
+        if self.ParentWindow:
+            self.ParentWindow.RefreshTitle()
+            self.ParentWindow.RefreshEditMenu()
     
     def ResetBuffer(self):
         if self.CurrentAction != None: