X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..768276f6ed4267a5768727cf06f636b2777e85da:/wxPython/wx/py/editor.py diff --git a/wxPython/wx/py/editor.py b/wxPython/wx/py/editor.py index 6a547188f7..be2f521b9c 100644 --- a/wxPython/wx/py/editor.py +++ b/wxPython/wx/py/editor.py @@ -14,12 +14,6 @@ import frame from shell import Shell import version -try: - True -except NameError: - True = 1==1 - False = 1==0 - class EditorFrame(frame.Frame): """Frame containing one editor.""" @@ -371,7 +365,7 @@ class EditorNotebook(wx.Notebook): def __init__(self, parent): """Create EditorNotebook instance.""" - wx.Notebook.__init__(self, parent, id=-1, style=wx.NO_FULL_REPAINT_ON_RESIZE) + wx.Notebook.__init__(self, parent, id=-1, style=wx.CLIP_CHILDREN) wx.EVT_NOTEBOOK_PAGE_CHANGING(self, self.GetId(), self.OnPageChanging) wx.EVT_NOTEBOOK_PAGE_CHANGED(self, self.GetId(), @@ -613,15 +607,18 @@ class Editor: def getStatus(self): """Return (filepath, line, column) status tuple.""" - pos = self.window.GetCurrentPos() - line = self.window.LineFromPosition(pos) + 1 - col = self.window.GetColumn(pos) - if self.buffer: - name = self.buffer.doc.filepath or self.buffer.name + if self.window: + pos = self.window.GetCurrentPos() + line = self.window.LineFromPosition(pos) + 1 + col = self.window.GetColumn(pos) + if self.buffer: + name = self.buffer.doc.filepath or self.buffer.name + else: + name = '' + status = (name, line, col) + return status else: - name = '' - status = (name, line, col) - return status + return ('', 0, 0) def getText(self): """Return contents of editor."""