mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Select the first item of a NSPopUpButtonCell's new menu
This commit is contained in:
parent
ec3353ecd8
commit
efb9bcb2e7
2 changed files with 7 additions and 2 deletions
|
@ -1,5 +1,9 @@
|
|||
2022-02-26 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSPopUpButtonCell.m(setMenu:): Select the first item of
|
||||
the menu instead of the last, as this is the only selection that
|
||||
makes sense for pull downs.
|
||||
|
||||
* Source/NSPopUpButtonCell.m: Never change the state of the
|
||||
selected item when configured as a pull down to match Apple's
|
||||
documentation and implementation.
|
||||
|
|
|
@ -210,8 +210,9 @@ static NSImage *_pbc_image[5];
|
|||
[self setMenuView: nil];
|
||||
}
|
||||
|
||||
// FIXME: Select the first or last item?
|
||||
[self selectItemAtIndex: [_menu numberOfItems] - 1];
|
||||
// Select the first item because that is the only selection that makes
|
||||
// sense for pull downs.
|
||||
[self selectItemAtIndex: [_menu numberOfItems] > 0 ? 0 : - 1];
|
||||
[self synchronizeTitleAndSelectedItem];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue