mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 19:11:56 +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;
|
return;
|
||||||
|
|
||||||
[_items insertObject: newItem atIndex: index];
|
[_items insertObject: newItem atIndex: index];
|
||||||
[newItem setMenu: self];
|
|
||||||
_changed = YES;
|
_changed = YES;
|
||||||
|
|
||||||
// Create the notification for the menu representation.
|
// Create the notification for the menu representation.
|
||||||
|
@ -264,6 +263,9 @@ static NSNotificationCenter *nc;
|
||||||
else
|
else
|
||||||
[_notifications addObject: inserted];
|
[_notifications addObject: inserted];
|
||||||
|
|
||||||
|
// Set this after the insert notification has been send.
|
||||||
|
[newItem setMenu: self];
|
||||||
|
|
||||||
// Update the menu.
|
// Update the menu.
|
||||||
[self update];
|
[self update];
|
||||||
}
|
}
|
||||||
|
@ -885,6 +887,7 @@ static NSNotificationCenter *nc;
|
||||||
self = [self initWithTitle: dTitle];
|
self = [self initWithTitle: dTitle];
|
||||||
[self setAutoenablesItems: dAuto];
|
[self setAutoenablesItems: dAuto];
|
||||||
|
|
||||||
|
[self setMenuChangedMessagesEnabled: NO];
|
||||||
/*
|
/*
|
||||||
* Make sure that items and submenus are set correctly.
|
* Make sure that items and submenus are set correctly.
|
||||||
*/
|
*/
|
||||||
|
@ -902,6 +905,7 @@ static NSNotificationCenter *nc;
|
||||||
[self setSubmenu: sub forItem: item];
|
[self setSubmenu: sub forItem: item];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[self setMenuChangedMessagesEnabled: YES];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue