Re: Text equivalent to a separator item?
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.