]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/editor/editor.py
wxPython tab cleaning
[wxWidgets.git] / wxPython / wx / lib / editor / editor.py
index d0a67cbeef8d7a3b2390f33b54313810e45541b2..943e42dd27a06185f8e449ac343c9c8d44043f07 100644 (file)
@@ -483,6 +483,7 @@ class Editor(wx.ScrolledWindow):
         self.SelectEnd = None
         self.UpdateView()
         self.CaptureMouse()
+        self.SetFocus()
 
     def OnLeftUp(self, event):
         if not self.HasCapture():
@@ -551,12 +552,13 @@ class Editor(wx.ScrolledWindow):
 
 
     def AdjustScrollbars(self):
-        for i in range(2):
-            self.SetCharDimensions()
-            self.scroller.SetScrollbars(
-                self.fw, self.fh,
-                self.CalcMaxLineLen()+3, max(self.LinesInFile()+1, self.sh),
-                self.sx, self.sy)
+        if self:
+            for i in range(2):
+                self.SetCharDimensions()
+                self.scroller.SetScrollbars(
+                    self.fw, self.fh,
+                    self.CalcMaxLineLen()+3, max(self.LinesInFile()+1, self.sh),
+                    self.sx, self.sy)
 
 #------------ backspace, delete, return