From 8c2d31e9f3bed594253daa8c097cbbfbc11f7151 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 18 Sep 2002 18:38:10 +0000 Subject: [PATCH] Delete the selection before inserting text in WriteText. Also, fix bug in repositioning of the caret after the insertion. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/demo/wxTextCtrl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wxPython/demo/wxTextCtrl.py b/wxPython/demo/wxTextCtrl.py index 381058bf3b..a62358571a 100644 --- a/wxPython/demo/wxTextCtrl.py +++ b/wxPython/demo/wxTextCtrl.py @@ -22,6 +22,7 @@ class TestPanel(wxPanel): l1 = wxStaticText(self, -1, "wxTextCtrl") t1 = wxTextCtrl(self, 10, "Test it out and see", size=(125, -1)) t1.SetInsertionPoint(0) + self.tc1 = t1 EVT_TEXT(self, 10, self.EvtText) EVT_CHAR(t1, self.EvtChar) EVT_SET_FOCUS(t1, self.OnSetFocus) @@ -88,7 +89,7 @@ class TestPanel(wxPanel): #self.tc.Remove(5, 9) def OnTestWriteText(self, evt): - self.tc.WriteText("TEXT") + self.tc1.WriteText("TEXT") def OnTestGetSelection(self, evt): start, end = self.tc.GetSelection()