• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: kEventParamMenuRef (was: _NSGetCarbonMenu) SOLVED
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

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>)
 >Re: kEventParamMenuRef (was: _NSGetCarbonMenu) (From: Ricky Sharp <email@hidden>)
 >Re: kEventParamMenuRef (was: _NSGetCarbonMenu) (From: Luc Vandal <email@hidden>)

  • Prev by Date: Re: kEventParamMenuRef (was: _NSGetCarbonMenu)
  • Next by Date: Bindings/archiving: NSMutableDictionary errors
  • Previous by thread: Re: kEventParamMenuRef (was: _NSGetCarbonMenu)
  • Next by thread: Re: kEventParamMenuRef (was: _NSGetCarbonMenu)
  • Index(es):
    • Date
    • Thread