]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/samples/ide/activegrid/tool/STCTextEditor.py
Applied patch [ 1212020 ] MediaCtrl DirectShow drawing and sample
[wxWidgets.git] / wxPython / samples / ide / activegrid / tool / STCTextEditor.py
index 8d27a19d24ace33557902ea8182d9449b5934683..113721029a12283b9d11ddb549ef67ee8ccf0db5 100644 (file)
@@ -194,10 +194,15 @@ class TextView(wx.lib.docview.View):
         if activate and self.GetCtrl():
             # In MDI mode just calling set focus doesn't work and in SDI mode using CallAfter causes an endless loop
             if self.GetDocumentManager().GetFlags() & wx.lib.docview.DOC_SDI:
-                self.GetCtrl().SetFocus()
+                self.SetFocus()
             else:
-                wx.CallAfter(self.GetCtrl().SetFocus)
-                   
+                wx.CallAfter(self.SetFocus)
+
+
+    def SetFocus(self):
+        if self.GetCtrl():
+            self.GetCtrl().SetFocus()
+            
                                 
     def OnClose(self, deleteWindow = True):
         if not wx.lib.docview.View.OnClose(self, deleteWindow):