Re: separatorItem in NSPopUpButton?
Re: separatorItem in NSPopUpButton?
- Subject: Re: separatorItem in NSPopUpButton?
- From: Stéphane Sudre <email@hidden>
- Date: Fri, 6 Jul 2001 17:01:19 +0200
On vendredi, juillet 6, 2001, at 04:24 PM, j o a r wrote:
Hello,
In IB it is possible to add separator items to the menu of a
NSPopUpButton. When I try to do the following in code (using the syntax
for a normal menu):
[presetsMenu addItem:[NSMenuItem separatorItem]];
I get this result:
Jul 06 16:18:53 Extensions Manager X[2811] An uncaught exception was
raised
Jul 06 16:18:53 Extensions Manager X[2811] *** -[NSPopUpButton
addItem:]: selector not recognized
Jul 06 16:18:53 Extensions Manager X[2811] *** Uncaught exception:
<NSInvalidArgumentException> *** -[NSPopUpButton addItem:]: selector
not recognized
Isn't it possible to add a separator through code?
While I'm not doing this that way, I don't see any reason why it
wouldn't work:
[[[presetsMenu cell] menu] addItem:[NSMenuItem separatorItem]];
or shorter
[[presetsMenu menu] addItem:[NSMenuItem separatorItem]];