Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kEventParamMenuRef (was: _NSGetCarbonMenu)




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >_NSGetCarbonMenu useage (From: Luc Vandal <email@hidden>)
 >Re: _NSGetCarbonMenu useage (From: Shawn Erickson <email@hidden>)
 >Re: _NSGetCarbonMenu useage (From: Luc Vandal <email@hidden>)
 >Re: _NSGetCarbonMenu useage (From: Ricky Sharp <email@hidden>)
 >Re: _NSGetCarbonMenu useage (From: Luc Vandal <email@hidden>)
 >Re: _NSGetCarbonMenu useage (From: Eric Schlegel <email@hidden>)
 >Re: kEventParamMenuRef (was: _NSGetCarbonMenu) (From: Luc Vandal <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.