• 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
Dock menu with indented items (like iTunes), how?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Dock menu with indented items (like iTunes), how?
  • From: "Sean McBride" <email@hidden>
  • Date: Mon, 6 Nov 2006 22:06:33 -0500

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Dock menu with indented items (like iTunes), how?
      • From: Rob Keniger <email@hidden>
  • Prev by Date: Re: scrolling and drawing porblems
  • Next by Date: Re: Dock menu with indented items (like iTunes), how?
  • Previous by thread: Re: scrolling and drawing porblems
  • Next by thread: Re: Dock menu with indented items (like iTunes), how?
  • Index(es):
    • Date
    • Thread