[WASTE-list] WESetEventTarget

Alfred Van Hoek vanhoek at mac.com
Sun Dec 11 08:49:27 EST 2005


On Dec 10, 2005, at 8:04 PM, Marco Piovanelli wrote:


> err = WESetEventTarget(GetWindowEventTarget(myWindow),

> weTextInputEvents, myWE);

>

> BTW, note that WESetEventTarget() is not just for text input events --

> it can also be used to install handlers for command events, or

> font panel events, etc., according to the options passed in the

> second parameter.

>


Yes, I figured but also have a lot of concerns:

Given that our waste-widget is living in a pane on a window, together
with other widgets that can have the focus, we will have to choose from
the following list:

GetEventDispatcherTarget
GetWindowEventTarget
GetControlEventTarget
HIObjectGetEventTarget
GetUserFocusEventTarget

The first two won't cut it, because once the focus is on a
non-waste-widget we experience crashes because our waste-widget is
trying to handle key downs, while it shouldn't (and we deactivated our
WEReference). The safest would be to use number 3 or 4, but it also
raises the question why you are not grabbing your GetControlEventTarget
or HIObjectGetEventTarget? Or should we use WESetEventTarget(nil) when
we deactivate the widget? GetUserFocusEventTarget will not necessarily
provide command keys, which waste 3 expect to arrive as well.

Is there a WASTE api that provides the ControlRef or HIObject, and can
the waste-widget also live on a non-composited window (alluding to
ControlRef or HIObject)?

For your info: each waste-widget we create on the window has its own
WEReference.

Alfred



More information about the WASTE-list mailing list