David Woods wrote:
As part of a larger app, I use a multiline wxTextCtrl as a simple note
editor.No matter what I do, when I call up my Note Editor, all of the text is
initially selected. I've messed with SetInsertionPoint,
SetInsertionPointEnd, and SetSelection, but my control still appears with
all text selected, and if I hit a key, it's all wiped out. (GetSelection
will appear to be correct, but it doesn't reflect the subsequent behavior of
the control.)I'm using wxPython 2.4.2.4 on Python 2.3.3 on Win2K.
Bind the EVT_SET_FOCUS event for the textctrl, and in that handler do something like this:
wxCallAfter(textctrl.SetSelection, 0, 0)
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!