mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-07 14:51:03 +00:00
Fix bug caused by the fix for #30025, which made it impossible to
programmatically change the selected item of some pop up buttons. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31158 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
20aeb6e85f
commit
034beeffb4
2 changed files with 11 additions and 4 deletions
|
@ -1,5 +1,9 @@
|
|||
2010-08-15 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSPopUpButtonCell.m (-selectItem): Fix bug caused by the
|
||||
fix for #30025, which made it impossible to programmatically
|
||||
change the selected item of some pop up buttons.
|
||||
|
||||
* Source/NSComboBoxCell.m (-runLoopWithComboBoxCell:): Dismiss
|
||||
the combo box's list without changing the selection when the user
|
||||
presses Escape.
|
||||
|
|
|
@ -661,6 +661,13 @@ static NSImage *_pbc_image[5];
|
|||
|
||||
_selectedItem = item;
|
||||
|
||||
/* Set the item in the menu */
|
||||
/* Note: Must do this before changing the state of the selected item, since
|
||||
* the change will recursively invoke synchronizeTitleAndSelectedItem, which
|
||||
* otherwise would select the old item again */
|
||||
[[_menu menuRepresentation] setHighlightedItemIndex:
|
||||
[_menu indexOfItem: _selectedItem]];
|
||||
|
||||
if (_selectedItem != nil)
|
||||
{
|
||||
if (_pbcFlags.altersStateOfSelectedItem)
|
||||
|
@ -669,10 +676,6 @@ static NSImage *_pbc_image[5];
|
|||
}
|
||||
}
|
||||
|
||||
/* Set the item in the menu */
|
||||
[[_menu menuRepresentation] setHighlightedItemIndex:
|
||||
[_menu indexOfItem: _selectedItem]];
|
||||
|
||||
if (oldSelectedItem)
|
||||
{
|
||||
[[_menu menuRepresentation] setNeedsDisplayForItemAtIndex:
|
||||
|
|
Loading…
Reference in a new issue