diff --git a/ChangeLog b/ChangeLog index d16015ec1..96fbda751 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-11 Fred Kiefer + + * Source/NSPopUpButtonCell.m (-_popUpItemAction:): New method used + by Apple NIB files. + Patch by Doug Simons . + 2009-04-10 15:30-EDT Gregory John Casamento * Source/NSApplication.m: Follow the NSApplication responder diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 19fdc7bb1..3e079b139 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -44,6 +44,10 @@ * and so on. */ static NSImage *_pbc_image[5]; +@interface NSPopUpButtonCell (CocoaExtensions) +- (void) _popUpItemAction: (id)sender; +@end + @implementation NSPopUpButtonCell + (void) initialize { @@ -384,6 +388,9 @@ static NSImage *_pbc_image[5]; // FIXME: The documentation is unclear what to set here. //[anItem setAction: [self action]]; //[anItem setTarget: [self target]]; + // Or + //[anItem setAction: @selector(_popUpItemAction:)]; + //[anItem setTarget: self]; // Select the new item if there isn't any selection. if (_selectedItem == nil) @@ -1207,3 +1214,15 @@ static NSImage *_pbc_image[5]; } @end + +@implementation NSPopUpButtonCell (CocoaExtensions) + +/* + * The selector for this method gets used by menu items in Apple NIB files. + */ +- (void) _popUpItemAction: (id)sender +{ + [NSApp sendAction: [self action] to: [self target] from: self]; +} + +@end