Re: kEventParamMenuRef (was: _NSGetCarbonMenu) SOLVED
Re: kEventParamMenuRef (was: _NSGetCarbonMenu) SOLVED
- Subject: Re: kEventParamMenuRef (was: _NSGetCarbonMenu) SOLVED
- From: Luc Vandal <email@hidden>
- Date: Wed, 04 May 2005 23:33:12 -0400
Never mind... GetEventKind() is what I need (it's obvious enough!!)
Luc
On 4-May-05, at 11:23 PM, Luc Vandal wrote:
One last thing: if I have more than one installed events for the same event handler, how can I get the event type ( such as kEventMenuTargetItem, kEventMenuBeginTracking, etc.) so that I know which event to handle? I've been looking in the docs/lists but couldn't find anything...
Thanks!
Luc
On 4-May-05, at 10:24 PM, Ricky Sharp wrote:
On May 4, 2005, at 8:57 PM, Luc Vandal wrote:
One thing though... I'm able to get the item index but I can't seem to be able to get a MenuRef.
MenuRef ref;
error = GetEventParameter( event, kEventParamMenuRef,
typeMenuRef, NULL, sizeof(MenuRef), NULL, &ref );
I get an -9870 error The piece of data you are requesting from an event is not present.
I believe the menu ref is actually the direct object in the event, so you should do something like this:
MenuRef theMenuRef;
OSStatus result = GetEventParameter (theEvent, kEventParamDirectObject,
typeMenuRef, NULL, sizeof (MenuRef), NULL, &theMenuRef);
One of the best places that describes the various carbon events (e.g. parameters along with their types) is the header itself:
Carbon/CarbonEvents.h
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden