[insertItem:atIndex:] set the menu of the item after the insert

notification has been send. [initWithCoder:] send change
notifications as one block.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10964 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2001-09-23 22:38:48 +00:00
parent 1159704830
commit 9b4da486b6

View file

@ -247,7 +247,6 @@ static NSNotificationCenter *nc;
return;
[_items insertObject: newItem atIndex: index];
[newItem setMenu: self];
_changed = YES;
// Create the notification for the menu representation.
@ -264,6 +263,9 @@ static NSNotificationCenter *nc;
else
[_notifications addObject: inserted];
// Set this after the insert notification has been send.
[newItem setMenu: self];
// Update the menu.
[self update];
}
@ -885,6 +887,7 @@ static NSNotificationCenter *nc;
self = [self initWithTitle: dTitle];
[self setAutoenablesItems: dAuto];
[self setMenuChangedMessagesEnabled: NO];
/*
* Make sure that items and submenus are set correctly.
*/
@ -902,6 +905,7 @@ static NSNotificationCenter *nc;
[self setSubmenu: sub forItem: item];
}
}
[self setMenuChangedMessagesEnabled: YES];
return self;
}