mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 08:50:57 +00:00
[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:
parent
1159704830
commit
9b4da486b6
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue