[WASTE-list] WESetEventTarget

Marco Piovanelli marco.piovanelli at pobox.com
Sat Dec 10 20:04:26 EST 2005


On Sat, 10 Dec 2005 12:38:19 -0500,
Alfred Van Hoek (vanhoek at mac.com) wrote:


>Ok, I understand the reasoning. However, it is unclear what exactly we

>need to provide to WASTE when using WESetEventTarget. Is it sufficient

>to just provide an EventTargetRef, no need to provide an UPP we define

>and no need to install the UPP-handler? Guess I can check myself, but

>it is not clear from the API.


Uh, I think I see where the confusion comes from.
This comment in WASTE.h:


>WEKey is deprecated in WASTE 3.0 -- instead of feeding raw keyboard

>events to WEKey, you should install text input event handlers on an

>event target by using WESetEventTarget


could perhaps be construed to mean you should install your own
event handlers. But in fact, it is WESetEventTarget() that
installs Carbon event handlers on your behalf. All you need
to provide is an event target. For example, to let WASTE handle
text input events targeted to myWindow, you would use code like
this:

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.


-- marco

--
It's not the data universe only, it's human conversation.
They want to turn it into a one-way flow that they have entirely
monetized. I look at the collective human mind as a kind of
ecosystem. They want to clear cut it. They want to go into the
rainforest of human thought and mow the thing down.



More information about the WASTE-list mailing list