Add a few key value bindings.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33277 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2011-06-11 12:01:59 +00:00
parent d25ee73927
commit c744492fee
8 changed files with 73 additions and 1 deletions

View file

@ -65,6 +65,9 @@ Class _nspopupbuttonCellClass = 0;
[self setCellClass: [NSPopUpButtonCell class]];
[self exposeBinding: NSSelectedIndexBinding];
[self exposeBinding: NSSelectedObjectBinding];
[self setKeys: [NSArray arrayWithObject: NSSelectedIndexBinding]
triggerChangeNotificationsForDependentKey: NSSelectedObjectBinding];
[self exposeBinding: NSSelectedTagBinding];
[self setKeys: [NSArray arrayWithObject: NSSelectedIndexBinding]
triggerChangeNotificationsForDependentKey: NSSelectedTagBinding];
@ -575,6 +578,10 @@ this to return nil to indicate that we have no context menu.
{
[self selectItemWithTag: [anObject integerValue]];
}
else if ([aKey isEqual: NSSelectedObjectBinding])
{
[self selectItemWithTag: [anObject intValue]];
}
else
{
[super setValue: anObject forKey: aKey];
@ -591,6 +598,10 @@ this to return nil to indicate that we have no context menu.
{
return [NSNumber numberWithInteger: [self selectedTag]];
}
else if ([aKey isEqual: NSSelectedObjectBinding])
{
return [NSNumber numberWithInt: [self selectedTag]];
}
else
{
return [super valueForKey: aKey];