X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c7c45995e61801b03c3ff3c3edbd84605860333d..c306c1e0f6c9e675aba8206f56cbf261d2506e41:/wxPython/wx/lib/expando.py diff --git a/wxPython/wx/lib/expando.py b/wxPython/wx/lib/expando.py index f16e5e1d52..c5e03e9c9f 100644 --- a/wxPython/wx/lib/expando.py +++ b/wxPython/wx/lib/expando.py @@ -90,7 +90,21 @@ class ExpandoTextCtrl(wx.TextCtrl): wx.TextCtrl.SetFont(self, font) self.numLines = -1 self._adjustCtrl() - + + def WriteText(self, text): + # work around a bug of a lack of a EVT_TEXT when calling + # WriteText on wxMac + wx.TextCtrl.WriteText(self, text) + self._adjustCtrl() + + def AppendText(self, text): + # Instead of using wx.TextCtrl.AppendText append and set the + # insertion point ourselves. This works around a bug on wxMSW + # where it scrolls the old text out of view, and since there + # is no scrollbar there is no way to get back to it. + self.SetValue(self.GetValue() + text) + self.SetInsertionPointEnd() + def OnTextChanged(self, evt): # check if any adjustments are needed on every text update @@ -144,7 +158,7 @@ class ExpandoTextCtrl(wx.TextCtrl): return sz.height - if wx.VERSION < (2,7) and 'wxGTK' in wx.PlatformInfo: + if 'wxGTK' in wx.PlatformInfo: ## and wx.VERSION < (2,7): it's broke again in 2.7.2... # the wxGTK version of GetNumberOfLines in 2.6 doesn't count # wrapped lines, so we need to implement our own. This is # fixed in 2.7.