GetValue() not working after using SetHint on a TextCtrl

18 views
Skip to first unread message

Francois Guibert

unread,
Jul 14, 2015, 8:07:49 PM7/14/15
to wxpytho...@googlegroups.com
Hi,

I updated to wxPython 3.0.2.0 especially for the API SetHint. However, when I use SetHint on a TextCtrl, GetValue always returns empty string.
Please see the attached sample. I tested it on Ubuntu 14.04 32b.
On this sample, you can also see that once you type text in the "hinted" TextCtrl and then click on the other TextCtrl, the text is cleared.

Anyone knows if this is a bug, an expected behavior and if I can fix it somehow?

Thanks,

Francois.
sethint_getvalue.py

Francois Guibert

unread,
Jul 20, 2015, 4:53:36 PM7/20/15
to wxpytho...@googlegroups.com
Well, there wasn't many interest in this question :), but just in case someone else encounters the issue, here is the fix:

My event handlers prevented the text from being set in the control. You can see the corrected sample attached (added event.Skip(), and set the handler on the frame instead of the control).
Now, why isn't this issue also present without hints is something I don't know.
sethint_getvalue_fixed.py
Reply all
Reply to author
Forward
0 new messages