Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dock menu with indented items (like iTunes), how?



Hi all,

I'm trying to make some indented menu items in my app's dock menu, like
iTunes does:

 "Now Playing"
   "Artist"
   "Song"

I'm using the code below, but it doesn't work.  The "Artist" menu is
there, but not indented.  One workaround is using '\t' or spaces, but
that seems lame.  Any ideas?

- (NSMenu*)applicationDockMenu:(NSApplication*)sender
{
	NSMenu*		menu = [[[NSMenu alloc] initWithTitle:
   @"Now Playing"] autorelease];
	[menu addItemWithTitle:@"Now Playing" action:nil
   keyEquivalent:@""];

	NSMenuItem*		item;	
	item = [[[NSMenuItem alloc] initWithTitle:@"Artist"
   action:nil keyEquivalent:@""] autorelease];
	[item setIndentationLevel:7];
	[menu addItem:item];

	return menu;
}

Thanks,

-- 
"When the winds of change are blowing, some people are building shelters
and others are building windmills" - Chinese proverb

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.