* Source/NSMenuView.m:

New private method [NSMenuView -_itemCell] in newly created
  GNUstepPrivate category.
* Source/NSMenu.m:
  Add GNUstepPrivate interface of NSMenuView.
  [NSMenu -_setOwnedByPopUp:]: update itemCells' menuView
  (fix NSPopUpButtonCell-decoding problem).
* Source/NSPopUpButtonCell.m
  ([NSPopUpButtonCell -synchronizeTitleAndSelectedItem]):
  Fix "mouseUp outside of menu" problem. Now the previous
  selected item stay selected.
  ([NSPopUpButtonCell -initWithCoder:]):
  Set the selectedItem properly.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14446 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
pyr 2002-09-15 14:02:17 +00:00
parent d2342fdf45
commit 0bf1a03438
4 changed files with 46 additions and 2 deletions

View file

@ -70,6 +70,11 @@
@end
@interface NSMenuView (GNUstepPrivate)
- (NSArray *)_itemCells;
@end
static NSZone *menuZone = NULL;
static NSString *NSMenuLocationsKey = @"NSMenuLocations";
static NSNotificationCenter *nc;
@ -1338,7 +1343,17 @@ static NSNotificationCenter *nc;
[_aWindow setLevel: NSPopUpMenuWindowLevel];
[_bWindow setLevel: NSPopUpMenuWindowLevel];
}
// FIXME
{
NSArray *itemCells = [_view _itemCells];
int i;
int count = [itemCells count];
for ( i = 0; i < count; i++ )
{
[[itemCells objectAtIndex: i] setMenuView: _view];
}
}
}
}