• 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: Two different actions depending on the event when clicking a NSStatusItem?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two different actions depending on the event when clicking a NSStatusItem?


  • Subject: Re: Two different actions depending on the event when clicking a NSStatusItem?
  • From: Ron Fleckner <email@hidden>
  • Date: Wed, 30 Jul 2008 23:17:48 +1000


On 30/07/2008, at 10:08 PM, email@hidden wrote:

Hi there.

My application uses a NSStatusItem. When somebody left-clicks on it I want
a method to be called (Which I've managed to fix) and then when somebody
right-clicks on it I want a menu to be shown. I can't seem to get that to
work. If I set a menu for the status item it shows up when somebody
left-clicks on it and the other method isn't called.


How do I fix it so that when somebody right-clicks on it, the menu shows
and when somebody left-clicks on it the other method is called?


Any help is appreciated.

/Tim Andersson

What you want is called a contextual menu. Find out how to implement it here:
<http://developer.apple.com/documentation/Cocoa/Conceptual/MenuList/ Articles/DisplayContextMenu.html>
There's even some sample code snippets.


Ron
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Two different actions depending on the event when clicking a NSStatusItem? (From: email@hidden)

  • Prev by Date: AuthorizationExecuteWithPrivileges flag error
  • Next by Date: Re: CSV parsing (large files)
  • Previous by thread: Two different actions depending on the event when clicking a NSStatusItem?
  • Next by thread: AuthorizationExecuteWithPrivileges flag error
  • Index(es):
    • Date
    • Thread