
164 9 Chapter 8: The Frameworks of Mac OS X: Carbon
Events that are received by a window have access to these
codes, and you can easily construct a switch statement that
lets you route events appropriately. You do not have to test
where the mouse was clicked to find out what interface ele-
ment was clicked on; you will receive that information direct-
ly from the event parameters.
The way you do that is to check the r value of the
command that is in the event. The code shown previously gets
that command:
ICommandcmd;
GetEventParameter ( inEvent,
kEventParamDirectObj ect,
typeHICommand,
NULL,
sizeof (HICommand) , NULL, &cmd) ;
Access ...