wxWindow::FindFocus() and wxTextCtrl woes under MAC
Richard Harvey Chapman
hchapman-wx-users at 3gfp.com
Tue Apr 3 06:28:54 PDT 2007
In order to get this to work, did you have to bind/connect the focus
events of each individual child widget?
R.
On Apr 3, 2007, at 9:17 AM, Jason Dolan 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).
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
R.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.wxwidgets.org/pipermail/wx-users/attachments/20070403/c3139e57/PGP.pgp
More information about the wx-users
mailing list