Add some debug information to find out why nodes are not being displayed in treecontroller

This commit is contained in:
Gregory John Casamento 2023-04-25 05:18:17 -04:00
parent 5d5d7d3fb4
commit 680ca38c29
2 changed files with 24 additions and 10 deletions

View file

@ -3498,6 +3498,7 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
#endif #endif
} }
NSLog(@"rowIndex = %ld, numberOfRows = %ld", rowIndex, numberOfRows);
if (rowIndex >= numberOfRows) if (rowIndex >= numberOfRows)
{ {
return; return;
@ -3545,11 +3546,8 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
} }
else else
{ {
id value = nil; id value = [ov _objectValueForTableColumn: tb
value = [ov _objectValueForTableColumn: tb
row: rowIndex]; row: rowIndex];
NSLog(@"value = %@", value);
[cell setObjectValue: value]; [cell setObjectValue: value];
} }

View file

@ -463,12 +463,26 @@ static NSImage *unexpandable = nil;
* Returns NO when the item is nil (as Cocoa does). * Returns NO when the item is nil (as Cocoa does).
*/ */
- (BOOL) isExpandable: (id)item - (BOOL) isExpandable: (id)item
{
BOOL result = NO;
if (_theBinding == nil)
{ {
if (item == nil) if (item == nil)
{ {
return NO; result = NO;
} }
return [_dataSource outlineView: self isItemExpandable: item]; else
{
result = [_dataSource outlineView: self isItemExpandable: item];
}
}
else
{
result = [[item valueForKeyPath: _leafKeyPath] boolValue];
}
return result;
} }
/** /**
@ -1850,6 +1864,8 @@ Also returns the child index relative to this parent. */
byItem: item]; byItem: item];
} }
NSLog(@"RESULT ======= %@, class = %@", result, NSStringFromClass([result class]));
return result; return result;
} }