From 83dba0e1a3bd3a53d90dfe5c512838a64f6ed8ce Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Mon, 10 Sep 2007 11:32:56 +0000 Subject: [PATCH] Select new item when there isn't any selection. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25474 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSPopUpButtonCell.m | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9733732ee..3359caca5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-09-10 Fred Kiefer + + * Source/NSPopUpButtonCell.m (-insertItemWithTitle:atIndex:): + Select new item when there isn't any selection. + 2007-09-10 Fred Kiefer * Source/NSTableHeaderView.m, diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 7a89e6088..852de2ff8 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -359,6 +359,12 @@ static NSImage *_pbc_image[2]; // FIXME: The documentation is unclear what to set here. //[anItem setAction: [self action]]; //[anItem setTarget: [self target]]; + + // Select the new item if there isn't any selection. + if (_selectedItem == nil) + { + [self selectItem: anItem]; + } } /**