Getting the last entered character from a TextCtrl
Saketh Bhamidipati
saketh.bhamidipati at gmail.com
Sun Aug 13 16:02:00 PDT 2006
I have a TextCtrl which has EVT_TEXT bound to a method, OnText. I need to
check what the last entered character was in OnText. In OnText(),
event.GetString() returns the whole TextCtrl value (as it should), but I
just want the last entered character.
I was thinking that the best way to do this would be to check the new
event.GetString() against the old one, slice the new one by the length of
the old one, and then set the old one to the new one. However, this doesn't
make much sense if the user is hitting backspace, which makes the length of
the old event.GetString() higher than that of the new event.GetString().
What's the best way to check the last entered character in a TextCtrl?
Thanks,
Saketh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200608=
13/fe7fbfb4/attachment.htm
More information about the wxpython-users
mailing list