Re: Can't get setDelegate to work on NSMenu attached to NSStatusItem
Re: Can't get setDelegate to work on NSMenu attached to NSStatusItem
- Subject: Re: Can't get setDelegate to work on NSMenu attached to NSStatusItem
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 4 Mar 2009 10:18:45 -0700
On Mar 4, 2009, at 9:42 AM, Mark D. Gerl wrote:
Any ideas??? I'm still stuck.
I already pointed out several problems with your code. But let me show
you what worked for me:
NSMenu *statusMenu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init]
autorelease];
_statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:
25.0] retain];
[_statusItem setImage:[NSImage imageNamed:...]];
[_statusItem setMenu:statusMenu];
[_statusItem setHighlightMode:YES];
[statusMenu setDelegate:self];
Then the delegate gets -menuNeedsUpdate: messages with no problems.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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