wxMac - Tab and Selection in wxTextCtrl (again)

Yoav Gonen YoavG at HumanEyes.com
Wed Oct 3 09:03:44 PDT 2007


Hi,
There was a thread more than a year ago about "TAB traversal on MacOSX".
Among other things, it discussed what happens to the selection of the
text after tabbing into a wxTextCtrl. However, it seemed to end in
"there is a problem in WX".
After a bit of debugging it seems to me that the wxTextCtrl "remembers"
its last selection, so if you tab out of it and then into it again, the
last text selected would be selected again. I think this is wrong - the
entire text should be selected regardless of what was selected
previously. BTW, this is what happens in iTunes and Xcode.
The code handling it is in the on-focus event handler, which also gets
called, for example, when you move the focus to a different *window* and
then back to the text control's container. In that case, the current
behavior might be desired. However, having it in the on-focus event
handler is pretty bad, because in every other case of focus acceptance -
tabbing into the control, mouse-clicking in it, dragging the mouse over
some text - you'd want a different behavior.
Does anybody have any suggestions? I don't mind fixing and submitting a
patch, but I'm not sure what should be done.
Thanks,
Yoav





More information about the wx-users mailing list