FROM : Matt Neuburg
DATE : Fri Aug 18 18:01:47 2006
On Fri, 18 Aug 2006 01:17:01 +0200, malcom <malcom.<email_removed>> said:
>I've created an NSPopUpButton menu inside an NSOutlineView corner view.
>This is the code for awakeFromNib:
>
>- (void) _initCornerView {
> NSPopUpButton * sortBtn ;
> sortBtn = [[ NSPopUpButton alloc] init ] ;
> [ sortBtn setImage: [NSImage imageNamed: @"flagged_header.tiff"] ];
> [ sortBtn setTarget: self ];
> [sortBtn setBordered:NO];
>
> [tagMenu release];
> tagMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle: @"Msg"];
> NSMenuItem *item = [[NSMenuItem alloc] initWithTitle: @"c" action:
>@selector(ctx_selectPopMenu:) keyEquivalent:@""];
> [item setTarget: self];
> [tagMenu addItem:item];
> [tagMenu setDelegate: self];
>
> [sortBtn setMenu: tagMenu];
> [ self setCornerView: sortBtn ];
>}
>
>Unfortunatly it does not work because the menu item still disabled.
>I've LAOtried to call [item setEnabled: YES] and [sortBtn
>setEnabled...] but nothing has changed... anyone can help me? thanks.
I have not tried this particular configuration, but I would think that the
menu enablement rules here would be the same as menu enablement rules
elsewhere. So, I would try implementing validateMenuItem: and see how you
go. At the very least, you'll know whether the enablement check is reaching
the right place. m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
DATE : Fri Aug 18 18:01:47 2006
On Fri, 18 Aug 2006 01:17:01 +0200, malcom <malcom.<email_removed>> said:
>I've created an NSPopUpButton menu inside an NSOutlineView corner view.
>This is the code for awakeFromNib:
>
>- (void) _initCornerView {
> NSPopUpButton * sortBtn ;
> sortBtn = [[ NSPopUpButton alloc] init ] ;
> [ sortBtn setImage: [NSImage imageNamed: @"flagged_header.tiff"] ];
> [ sortBtn setTarget: self ];
> [sortBtn setBordered:NO];
>
> [tagMenu release];
> tagMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle: @"Msg"];
> NSMenuItem *item = [[NSMenuItem alloc] initWithTitle: @"c" action:
>@selector(ctx_selectPopMenu:) keyEquivalent:@""];
> [item setTarget: self];
> [tagMenu addItem:item];
> [tagMenu setDelegate: self];
>
> [sortBtn setMenu: tagMenu];
> [ self setCornerView: sortBtn ];
>}
>
>Unfortunatly it does not work because the menu item still disabled.
>I've LAOtried to call [item setEnabled: YES] and [sortBtn
>setEnabled...] but nothing has changed... anyone can help me? thanks.
I have not tried this particular configuration, but I would think that the
menu enablement rules here would be the same as menu enablement rules
elsewhere. So, I would try implementing validateMenuItem: and see how you
go. At the very least, you'll know whether the enablement check is reaching
the right place. m.
--
matt neuburg, phd = <email_removed>, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
| Related mails | Author | Date |
|---|---|---|
| malcom | Aug 18, 01:17 | |
| Matt Neuburg | Aug 18, 18:01 | |
| malcom | Aug 18, 18:47 |






Cocoa mail archive

