How to define scroll for NSOutlineView?

I have two NSOutlineViews shown side by side, they contain the same number of rows (this is a precondition), and I need to synchronize them when the user scrolls with the mouse, keyboard or scroll bars, so I see the same part of the view (or strings).

I am new to the land of Cocoa and I cannot find how to do this.

+3
source share
1 answer

You want to get a clip view in the NSOutlineView scroll box:

NSClipView * clipView = [[outlineView enclosingScrollView] contentView];

... and set it to -setPostsFrameChangedNotifications: YES. Listen to NSViewFrameDidChangeNotification from this view and respond accordingly.

: . -contentView: , . -contentView: NSClipView, -documentView: .

+3

Source: https://habr.com/ru/post/1772646/


All Articles