wxWindow::FindFocus() and wxTextCtrl woes under MAC
Jason Dolan
jayson.dolan at gmail.com
Wed Apr 4 07:28:25 PDT 2007
Sorry for the breach in netiquette... but I'm bumping this post. This
seems like a bug to me, especially since it works how you would expect
under Windows and Linux, but not Mac. Any ideas?
-Jason
On Apr 3, 9:17 am, "Jason Dolan" <jayson.do... at gmail.com> wrote:
> Running wxMac-2.8.3
>
> I have a derived dialog that catches all wxEVT_CHILD_FOCUS events for
> it's children. That event is caught in a function that looks similar
> to this:
>
> MyDialog::CatchFocusEvents(wxChildFocusEvent &event)
> {
> cerr << "Entering CatchFocusEvents!" << endl;
> wxWindow *pWinFocused = FindFocus();
> if(pWinFocused != NULL)
> cerr << pWinFocused->GetName()->ToAscii() << " just recieved
> focus!" << endl;
>
> }
>
> Testing this program I find that clicking on a wxTextCtrl, the first
> output ("Entering CatchFocusEvents!") prints out, but the second one
> does not. But clicking on the ListCtrl (that is also in the dialog)
> will print out both outputs. So it seems like FindFocus() cannot
> determine if a textctrl currently has focus.
>
> As a side note, this code works how I would expect it to under Windows
> and Linux (both running 2.8.3).
More information about the wx-users
mailing list