Add more calls to synchronizeTitleAndSelectedItem. This should fix the

remaining cases of bug #30025.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31111 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2010-08-10 21:44:49 +00:00
parent 16dfee54d9
commit a560a65e72
2 changed files with 27 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2010-08-10 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSPopUpButtonCell.m (-setPullsDown:): Call
synchronizeTitleAndSelectedItem to display the correct item.
* Source/NSPopUpButtonCell.m (-setMenu:): Listen to notifications
from the menu to call synchronizeTitleAndSelectedItem, when the
menu items change.
2010-08-10 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSTextStorage.m: Follow Richard's changes to

View file

@ -157,6 +157,8 @@ static NSImage *_pbc_image[5];
*/
- (void) setMenu: (NSMenu *)menu
{
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
if (_menu == menu)
{
return;
@ -165,6 +167,9 @@ static NSImage *_pbc_image[5];
if (_menu != nil)
{
[_menu _setOwnedByPopUp: nil];
[nc removeObserver: self
name: nil
object: _menu];
}
ASSIGN(_menu, menu);
if (_menu != nil)
@ -174,6 +179,18 @@ static NSImage *_pbc_image[5];
* popupbutton code in super class NSMenuItemCell
*/
[self setMenuView: [_menu menuRepresentation]];
[nc addObserver: self
selector: @selector(synchronizeTitleAndSelectedItem)
name: NSMenuDidAddItemNotification
object: _menu];
[nc addObserver: self
selector: @selector(synchronizeTitleAndSelectedItem)
name: NSMenuDidRemoveItemNotification
object: _menu];
[nc addObserver: self
selector: @selector(synchronizeTitleAndSelectedItem)
name: NSMenuDidChangeItemNotification
object: _menu];
}
else
{
@ -202,7 +219,7 @@ static NSImage *_pbc_image[5];
}
/**
* Returns YES, if this is a pull-down
* Set the pull-down state
*/
- (void) setPullsDown: (BOOL)flag
{
@ -218,6 +235,7 @@ static NSImage *_pbc_image[5];
_pbcFlags.pullsDown = flag;
[self setMenuItem: item];
[self synchronizeTitleAndSelectedItem];
}
/**