• 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
Re: Text equivalent to a separator item?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text equivalent to a separator item?


  • Subject: Re: Text equivalent to a separator item?
  • From: Kurt Revis <email@hidden>
  • Date: Sun, 24 Mar 2002 13:02:17 -0800

On Sunday, March 24, 2002, at 12:01 PM, Nicholas Riley wrote:

On Sun, Mar 24, 2002 at 02:35:29PM -0500, Rich Long wrote:
I'm populating a menu (NSPopupButtonCell) with an array of strings
using addItemsWithTitles, and I'd like to include a separator. Is
there a text equivalent to the separator item?

Nope. Nothing like '-' in (older) Carbon apps - what a complete pain
when you were trying to insert user-named items in a list and had to
make special arrangements to make sure they didn't get turned into
separators. You're welcome to build one yourself - adding lots of
individual NSMenuItems isn't too costly.

More specifically, here's how you do it:

[[popUpButtonCell menu] addItem:[NSMenuItem separatorItem]];

If you have an NSPopUpButton, you can do the same thing without going through the cell.

--
Kurt Revis
email@hidden
_______________________________________________
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.

References: 
 >Re: Text equivalent to a separator item? (From: Nicholas Riley <email@hidden>)

  • Prev by Date: Re: NSSet Inefficiency
  • Next by Date: palettes
  • Previous by thread: Re: Text equivalent to a separator item?
  • Next by thread: Re: Cocoa and UNIX txt files ??
  • Index(es):
    • Date
    • Thread