mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 11:41:05 +00:00
Set the target/action to nil/NULL so that the items are enabled
This commit is contained in:
parent
71114f34c6
commit
92ac127ebc
2 changed files with 20 additions and 2 deletions
|
@ -64,11 +64,24 @@
|
|||
- (void) finishInstantiate
|
||||
{
|
||||
NSView *contentView = [originalWindow contentView];
|
||||
NSArray *allItems = nil;
|
||||
NSEnumerator *en = nil;
|
||||
id item = nil;
|
||||
|
||||
_prototypePopUp = [[GormNSPopUpButton alloc] initWithFrame: NSMakeRect(71.0, 157.0, 102.0, 24.0)];
|
||||
[_prototypePopUp addItemWithTitle: @"Item #0"];
|
||||
[_prototypePopUp addItemWithTitle: @"Item #1"];
|
||||
[_prototypePopUp addItemWithTitle: @"Item #2"];
|
||||
[_prototypePopUp setAutoenablesItems: YES];
|
||||
|
||||
allItems = [[_prototypePopUp menu] itemArray];
|
||||
en = [allItems objectEnumerator];
|
||||
while ((item = [en nextObject]) != nil)
|
||||
{
|
||||
[item setTarget: nil];
|
||||
[item setAction: NULL]; // @selector(_popUpItemAction:)];
|
||||
[item setEnabled: YES];
|
||||
}
|
||||
|
||||
[contentView addSubview: _prototypePopUp];
|
||||
AUTORELEASE(_prototypePopUp);
|
||||
|
|
|
@ -78,7 +78,12 @@
|
|||
[object setPullsDown: pullsDown];
|
||||
while ((o = [en nextObject]) != nil)
|
||||
{
|
||||
id<NSMenuItem> mi = nil;
|
||||
|
||||
[object addItemWithTitle: [o title]];
|
||||
mi = [object lastItem];
|
||||
[mi setAction: NULL]; // @selector(_popUpItemAction:)];
|
||||
[mi setTarget: nil];
|
||||
}
|
||||
}
|
||||
else if (sender == autoenableSwitch)
|
||||
|
|
Loading…
Reference in a new issue