[wxMac] text event handling (embedded)
Chad Wagner
chad at chadawagner.com
Tue Jul 24 08:10:39 PDT 2007
I'm using wxWidgets for my plugin that runs within a variety of host
apps. the host passes me a WindowRef, and I have derived my own top
level window that does not create a new window but rather wraps the
window I was given into a wxWindow.
I had been using MacInstallTopLevelWindowEventHandler() to attach the
standard wxWidgets handlers to my window, but there are issues with
text input (works fine in some hosts, not at all in others, and in
some depending on whether my window has lost focus since creation,
etc...)
As a test, I tried it without any of the wx handlers, and defined my
own just for text:
static const EventTypeSpec kKeyboardFocusEvents[] =
{
{ kEventClassControl, kEventControlSetFocusPart },
{ kEventClassTextInput, kEventTextInputUnicodeForKeyEvent }
};
result = InstallWindowEventHandler(MAC_WXHWND(m_macWindow),
GetMyHandlerUPP(),
GetEventTypeCount(kKeyboardFocusEvents),
kKeyboardFocusEvents, this, &m_myEventHandler );
This works like a charm, I get all text event in all hosts just as I
would expect.
So that's the setup, now for the question: Does anyone have an idea
what it is about the standard wxWidgets event handlers that is
interfering with my text events, and what I might do to fix it or
work around it? I would hate to have to redefine all my own event
handlers, as the standard ones seem to be working just fine for
everything other than text. Besides, I'm no guru, and handling *all*
events myself is probably more than I can (ahem) handle.
thanks!!
-chad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20070724/7dab4f28/attachment.htm
More information about the wx-users
mailing list