From 5bceae9f01b1781cdd094472e83c4038d90d1299 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Wed, 8 Mar 2023 10:43:41 -0500 Subject: [PATCH] Update headers --- Headers/AppKit/NSTreeController.h | 2 +- Source/NSTreeController.m | 39 +++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/Headers/AppKit/NSTreeController.h b/Headers/AppKit/NSTreeController.h index fb3967652..0a18bff09 100644 --- a/Headers/AppKit/NSTreeController.h +++ b/Headers/AppKit/NSTreeController.h @@ -86,7 +86,7 @@ APPKIT_EXPORT_CLASS - (void) setAvoidsEmptySelection: (BOOL)flag; - (void) setChildrenKeyPath: (NSString*)path; - (void) setCountKeyPath: (NSString*)path; -- (void) setLeafPathKey: (NSString*)key; +- (void) setLeafKeyPath: (NSString*)key; - (void) setPreservesSelection: (BOOL)flag; - (void) setSelectsInsertedObjects: (BOOL)flag; - (void) setSortDescriptors: (NSArray*)descriptors; diff --git a/Source/NSTreeController.m b/Source/NSTreeController.m index 71a9915a7..611a8181e 100644 --- a/Source/NSTreeController.m +++ b/Source/NSTreeController.m @@ -1,5 +1,5 @@ - /* - NSTreeController.h + /* + NSTreeController.m The tree controller class. @@ -7,7 +7,7 @@ Author: Gregory Casamento Date: 2012 - + This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or @@ -22,27 +22,46 @@ You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. - If not, see or write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, + If not, see or write to the + Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ +*/ #import #import +#import #import #import -#import -#import +#import "AppKit/NSKeyValueBinding.h" +#import "AppKit/NSTreeController.h" +#import "AppKit/NSTreeNode.h" + +#import "GSBindingHelpers.h" +#import "GSFastEnumeration.h" @implementation NSTreeController ++ (void) initialize +{ + if (self == [NSTreeController class]) + { + [self exposeBinding: NSContentArrayBinding]; + [self setKeys: [NSArray arrayWithObjects: NSContentBinding, NSContentObjectBinding, nil] + triggerChangeNotificationsForDependentKey: @"arrangedObjects"]; + } +} + - (id) initWithContent: (id)content { if ((self = [super initWithContent: content]) != nil) { + _childrenKeyPath = nil; + _countKeyPath = nil; + _leafKeyPath = nil; + _sortDescriptors = nil; } - + return self; } @@ -238,7 +257,7 @@ ASSIGN(_countKeyPath, path); } -- (void) setLeafPathKey: (NSString*)key +- (void) setLeafKeyPath: (NSString*)key { ASSIGN(_leafKeyPath, key); }