Prevent problems showing ST code after failed build
authoretisserant
Tue, 21 Aug 2007 08:54:41 +0200
changeset 73 f2529e34e4b7
parent 72 73212220ad22
child 74 a33f06a63e1d
Prevent problems showing ST code after failed build
TextViewer.py
--- a/TextViewer.py	Thu Aug 16 10:40:27 2007 +0200
+++ b/TextViewer.py	Tue Aug 21 08:54:41 2007 +0200
@@ -142,11 +142,12 @@
 
         self.SetModEventMask(wx.stc.STC_MOD_BEFOREINSERT|wx.stc.STC_MOD_BEFOREDELETE)
 
-        self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
-        self.Bind(wx.stc.EVT_STC_STYLENEEDED, self.OnStyleNeeded, id=ID_TEXTVIEWER)
-        self.Bind(wx.stc.EVT_STC_DO_DROP, self.OnDoDrop, id=ID_TEXTVIEWER)
-        self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
-        self.Bind(wx.stc.EVT_STC_MODIFIED, self.OnModification, id=ID_TEXTVIEWER)
+	    self.Bind(wx.stc.EVT_STC_STYLENEEDED, self.OnStyleNeeded, id=ID_TEXTVIEWER)
+        if window and 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)
+            self.Bind(wx.stc.EVT_STC_MODIFIED, self.OnModification, id=ID_TEXTVIEWER)
     
     def OnModification(self, event):
         if not self.DisableEvents: