applicationDockMenu: woes
applicationDockMenu: woes
- Subject: applicationDockMenu: woes
- From: David Watanabe <email@hidden>
- Date: Tue, 06 Jul 2004 16:45:41 -0600
Hey all, I'm encountering some sub-optimal behavior when attempting to
have a dynamic dock menu via applicationDockMenu: in my NSApplication
delegate.
The following is some sample code that illustrates two display issues
I'm facing when the menu is actually shown in the Dock (on OS X
10.3.4). Firstly, the separator item is not drawn as a separator, but
rather as regular item that is empty (not good). The second problem is
that the menu items' images are not shown at all (not a major problem,
but aesthetically problematic).
Anyone know what's going on? I've considered falling down into Carbon,
hoping that things might work on that level, but my attempts to do so
have thus far failed.
Cheers!
Dave Watanabe
- (NSMenu*) applicationDockMenu: (id) sender;
{
/* allocate menu */
NSMenu* result = [[[NSMenu alloc] initWithTitle: @""]
autorelease];
id item;
/* add first sample item */
item = [[[NSMenuItem alloc] initWithTitle: @"First Sample Item"
action: @selector(whatever:) keyEquivalent: @""] autorelease];
[item setImage: [NSImage imageNamed: @"PlayList"]];
[result addItem: item];
/* add separator */
[result addItem: [NSMenuItem separatorItem]];
/* add second sample item */
item = [[[NSMenuItem alloc] initWithTitle: @"Second Sample
Item" action: @selector(whatever:) keyEquivalent: @""] autorelease];
[item setImage: [NSImage imageNamed: @"PlayList"]];
[result addItem: item];
return result;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.