Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated PR for NSOutlineView/NSTreeController due to refactor #277

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

gcasa
Copy link
Member

@gcasa gcasa commented Jun 19, 2024

Subject summarizes. This PR is meant to implement NSTreeController and NSOutlineView integration. I made a new branch since NSOutlineView was heavily modified in the PR addressing NSTableRowView here.

@gcasa gcasa requested a review from fredkiefer as a code owner June 19, 2024 05:50
@gcasa gcasa marked this pull request as draft June 19, 2024 05:51
@gcasa
Copy link
Member Author

gcasa commented Jun 19, 2024

@fredkiefer This is not yet ready for review. I will convert it when it is. Thanks.

@gcasa
Copy link
Member Author

gcasa commented Jun 24, 2024

Interesting indeed...

Found 20 methods on '_NSControllerTreeProxy'
	'_NSControllerTreeProxy' has method named 'count' of encoding 'Q16@0:8'
	'_NSControllerTreeProxy' has method named 'indexPath' of encoding '@16@0:8'
	'_NSControllerTreeProxy' has method named 'parentNode' of encoding '@16@0:8'
	'_NSControllerTreeProxy' has method named '_invokeSelector:withArguments:onKeyPath:ofObjectAtIndexPath:' of encoding 'v48@0:8:16@24@32@40'
	'_NSControllerTreeProxy' has method named '_setValue:forKeyPath:ofObjectAtIndexPath:' of encoding 'v40@0:8@16@24@32'
	'_NSControllerTreeProxy' has method named '_validateValue:forKeyPath:ofObjectAtIndexPath:error:' of encoding 'c48@0:8^@16@24@32^@40'
	'_NSControllerTreeProxy' has method named '_valueForKeyPath:ofObjectAtIndexPath:' of encoding '@32@0:8@16@24'
	'_NSControllerTreeProxy' has method named 'childNodes' of encoding '@16@0:8'
	'_NSControllerTreeProxy' has method named 'countForIndexPath:' of encoding 'Q24@0:8@16'
	'_NSControllerTreeProxy' has method named 'countOfChildNodes' of encoding 'Q16@0:8'
	'_NSControllerTreeProxy' has method named 'descendantNodeAtIndexPath:' of encoding '@24@0:8@16'
	'_NSControllerTreeProxy' has method named 'initWithController:' of encoding '@24@0:8@16'
	'_NSControllerTreeProxy' has method named 'isExpandableAtArrangedObjectIndexPath:' of encoding 'c24@0:8@16'
	'_NSControllerTreeProxy' has method named 'isLeaf' of encoding 'c16@0:8'
	'_NSControllerTreeProxy' has method named 'mutableChildNodes' of encoding '@16@0:8'
	'_NSControllerTreeProxy' has method named 'nodeAtIndexPath:' of encoding '@24@0:8@16'
	'_NSControllerTreeProxy' has method named 'objectAtIndexPath:' of encoding '@24@0:8@16'
	'_NSControllerTreeProxy' has method named 'objectInChildNodesAtIndex:' of encoding '@24@0:8Q16'
	'_NSControllerTreeProxy' has method named 'representedObject' of encoding '@16@0:8'
	'_NSControllerTreeProxy' has method named 'sortWithSortDescriptors:recursively:' of encoding 'v28@0:8@16c24'

I am introducing an equivalent class GSControllerTreeProxy to fill this role, it will be a subclass of NSTreeNode, just as _NSTreeControllerProxy is. Apparently, NSTreeController is not meant to handle an NSArray of objects. This is apparent from the documentation as - (NSTreeNode *) arrangedObjects is defined as such.

I will need to work out the nuances of how this handles various bindings.

@gcasa
Copy link
Member Author

gcasa commented Jun 24, 2024

The test for this is here... https://github.com/gcasa/NSTreeController_test

@gcasa
Copy link
Member Author

gcasa commented Jun 27, 2024

Here is NSOutlineView using a dataSource...

outline_normal

And here it is using a binding...

outline_tree_controller

This demonstrates that the new code does not affect outline view functionality in other applications.

@gcasa
Copy link
Member Author

gcasa commented Jun 27, 2024

I am marking this as ready for review and proceeding to optimize and clean up the code in preparation for merge.

@gcasa gcasa marked this pull request as ready for review June 27, 2024 09:45
@gcasa
Copy link
Member Author

gcasa commented Jun 27, 2024

Of course, Gorm works as well...

gorm_of_course

@gcasa
Copy link
Member Author

gcasa commented Jun 28, 2024

@fredkiefer These changes are mainly about the binding between NSTreeController and NSOutlineView. More changes might be forthcoming, but I will do some of the other methods as separate PR. Please take a moment to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants