Added NSWindow 'title' binding

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29113 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
qmathe 2009-12-10 12:43:35 +00:00
parent 30108b6069
commit 3e5a1cefaa
4 changed files with 35 additions and 0 deletions

View file

@ -66,6 +66,7 @@
#include "AppKit/NSFont.h"
#include "AppKit/NSGraphics.h"
#include "AppKit/NSHelpManager.h"
#include "AppKit/NSKeyValueBinding.h"
#include "AppKit/NSImage.h"
#include "AppKit/NSMenu.h"
#include "AppKit/NSPasteboard.h"
@ -75,6 +76,7 @@
#include "AppKit/NSView.h"
#include "AppKit/NSWindow.h"
#include "AppKit/NSWindowController.h"
#include "GSBindingHelpers.h"
#include "AppKit/PSOperators.h"
#include "GNUstepGUI/GSTrackingRect.h"
#include "GNUstepGUI/GSDisplayServer.h"
@ -620,6 +622,8 @@ static NSNotificationCenter *nc = nil;
windowmaps = NSCreateMapTable(NSIntMapKeyCallBacks,
NSNonRetainedObjectMapValueCallBacks, 20);
nc = [NSNotificationCenter defaultCenter];
[self exposeBinding: NSTitleBinding];
}
}
@ -5179,6 +5183,28 @@ current key view.<br />
return self;
}
- (void) bind: (NSString *)binding
toObject: (id)anObject
withKeyPath: (NSString *)keyPath
options: (NSDictionary *)options
{
if ([binding isEqual: NSTitleBinding])
{
[self unbind: binding];
[[GSKeyValueBinding alloc] initWithBinding: @"title"
withName: NSTitleBinding
toObject: anObject
withKeyPath: keyPath
options: options
fromObject: self];
}
else
{
[super bind: binding toObject: anObject withKeyPath: keyPath
options: options];
}
}
/**
Returns all drawers associated with this window.
*/