]> git.saurik.com Git - wxWidgets.git/commitdiff
Ensure the window is still valid before adjusting the scrollbars
authorRobin Dunn <robin@alldunn.com>
Sun, 29 Jan 2006 02:36:29 +0000 (02:36 +0000)
committerRobin Dunn <robin@alldunn.com>
Sun, 29 Jan 2006 02:36:29 +0000 (02:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wx/lib/editor/editor.py

index 351e5f3d89b4ca53971c3f103d94a0209f1f8dda..943e42dd27a06185f8e449ac343c9c8d44043f07 100644 (file)
@@ -552,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