Ticket #14970 (closed defect: fixed)
SearchCtrl HasFocus() doesn't report correct status
| Reported by: | fhjull00 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | wxPython | Version: | 2.9.4 |
| Keywords: | SearchCtrl, HasFocus | Cc: | |
| Blocked By: | Patch: | no | |
| Blocking: |
Description
SearchCtrl control doesn't seem to return HasFocus() correctly - when cursor is inside SearchCtrl TextCtrl, then
print searchCtrl.HasFocus() >>> False
The workaround is to get list of children and query focus for them:
for searchFieldChild in searchCtrl.GetChildren(): print searchFieldChild, searchFieldChild.HasFocus() >>> <wx._controls.TextCtrl; proxy of <Swig Object of type 'wxTextCtrl *' at 0x40ae5e8> > True >>> <wx._core.Control; proxy of <Swig Object of type 'wxControl *' at 0x3f9b7b0> > False >>> <wx._core.Control; proxy of <Swig Object of type 'wxControl *' at 0x3f9c3b8> > False
Is this desired or should TextCtrl portion of SearchCtrl return the same HasFocus() value as SearchCtrl itself?
I am using wxPython 2.9.4.0 on Windows 7 x64 with Python 2.7 (x32).
Change History
Note: See
TracTickets for help on using
tickets.
