Add code to handle Title property on NSTableColumn, add code to NSTableView to set the table view to _viewBased if it responds to tableView:viewForTableColumn:row:

This commit is contained in:
Gregory John Casamento 2024-04-18 02:54:03 -04:00
parent 8895bd0335
commit e55babb04e
3 changed files with 22 additions and 1 deletions

View file

@ -133,6 +133,13 @@ APPKIT_EXPORT_CLASS
- (void) setSortDescriptorPrototype: (NSSortDescriptor *)aSortDescriptor;
- (NSSortDescriptor *) sortDescriptorPrototype;
#endif
/*
* Title
*/
#if OS_API_VERSION(MAC_OS_X_VERSION_10_10, GS_API_LATEST)
- (void) setTitle: (NSString *)title;
- (NSString *) title;
#endif
@end
/* Notifications */

View file

@ -656,6 +656,16 @@ to YES. */
return _prototypeCellViews;
}
- (void) setTitle: (NSString *)title
{
[_headerCell setStringValue: title];
}
- (NSString *) title
{
return [_headerCell stringValue];
}
- (void) setValue: (id)anObject forKey: (NSString*)aKey
{
if ([aKey isEqual: NSValueBinding])

View file

@ -5339,7 +5339,8 @@ This method is deprecated, use -columnIndexesInRect:. */
- (void) setDelegate: (id)anObject
{
const SEL sel = @selector(tableView:willDisplayCell:forTableColumn:row:);
const SEL vbsel = @selector(tableView:viewForTableColumn:row:);
if (_delegate)
[nc removeObserver: _delegate name: nil object: self];
_delegate = anObject;
@ -5357,6 +5358,9 @@ This method is deprecated, use -columnIndexesInRect:. */
/* Cache */
_del_responds = [_delegate respondsToSelector: sel];
/* Test to see if it is view based */
_viewBased = [_delegate respondsToSelector: vbsel];
}
- (id) delegate