• 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
applicationDockMenu: woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: applicationDockMenu: woes
      • From: Eric Schlegel <email@hidden>
    • Re: applicationDockMenu: woes
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: Selecting a cell within NSTableView
  • Next by Date: Re: WebKit and saving position through a reload
  • Previous by thread: Re: Objective-C and JDBC
  • Next by thread: Re: applicationDockMenu: woes
  • Index(es):
    • Date
    • Thread