* Source/NSPopUpButtonCell.m (-initWithCoder:): If no selection

index is given select the first item. This should fix bug #34923.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34228 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2011-11-28 20:29:35 +00:00
parent 8206073dbc
commit 0b555a3084
2 changed files with 20 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2011-11-28 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSPopUpButtonCell.m (-initWithCoder:): If no selection
index is given select the first item. This should fix bug #34923.
2011-11-28 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTextView.m (-buildUpTextNetwork:): Move setting the

View file

@ -204,6 +204,7 @@ static NSImage *_pbc_image[5];
[self setMenuView: nil];
}
// FIXME: Select the first or last item?
[self selectItemAtIndex: [_menu numberOfItems] - 1];
[self synchronizeTitleAndSelectedItem];
}
@ -1233,6 +1234,11 @@ static NSImage *_pbc_image[5];
[self setAltersStateOfSelectedItem: alters];
}
if ([aDecoder containsValueForKey: @"NSPullDown"])
{
BOOL pullDown = [aDecoder decodeBoolForKey: @"NSPullDown"];
[self setPullsDown: pullDown];
}
if ([aDecoder containsValueForKey: @"NSUsesItemFromMenu"])
{
BOOL usesItem = [aDecoder decodeBoolForKey: @"NSUsesItemFromMenu"];
@ -1256,13 +1262,17 @@ static NSImage *_pbc_image[5];
{
int selectedIdx = [aDecoder decodeIntForKey:
@"NSSelectedIndex"];
[self selectItem: [self itemAtIndex: selectedIdx]];
[self selectItemAtIndex: selectedIdx];
}
if ([aDecoder containsValueForKey: @"NSPullDown"])
else
{
BOOL pullDown = [aDecoder decodeBoolForKey: @"NSPullDown"];
[self setPullsDown: pullDown];
}
[self selectItemAtIndex: 0];
}
if ([aDecoder containsValueForKey: @"NSMenuItem"])
{
NSMenuItem *item = [aDecoder decodeObjectForKey: @"NSMenuItem"];
[self setMenuItem: item];
}
}
else
{