Re: Two different actions depending on the event when clicking a NSStatusItem?
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