Questions tagged [nsoutlineview]

NSOutlineView is a subclass of NSTableView that uses a row-and-column format to display hierarchical data that can be expanded and collapsed, such as directories and files in a file system. A user can expand and collapse rows, edit values, and resize and rearrange columns.

Like a table view, an outline view does not store its own data, instead it retrieves data values as needed from a data source to which it has a weak reference (see Communicating With Objects). See the NSOutlineViewDataSource protocol, which declares the methods that an NSOutlineView object uses to access the contents of its data source object.

An outline view has the following features:

  • A user can expand and collapse rows.

  • Each item in the outline view must be unique. In order for the collapsed state to remain consistent between reloads the item's pointer must remain the same.

  • The view gets data from a data source (see the NSOutlineViewDataSource protocol).

  • The view retrieves only the data that needs to be displayed.

659 questions
5
votes
2 answers

Changing NSTableCellView's objectValue in view-based NSOutlineView does not propagate to dataSource

I use a view-based NSOutlineView to display and select hierarchically structured items for a scientific application. Each row in the outline column represents an item, signified by an item-specific icon (all the same in the picture), a checkbox…
timo
  • 79
  • 6
5
votes
2 answers

View-based NSOutlineview selection gradient

I'm still struggling with the view-based NSOutlineView in my little Cocoa application. I'm trying model my OutlineView after the finder one. When the Finder OutlineView loses focus (e.g. clicking any folder on the right side), the selected row (e.g.…
BinaryBucks
  • 976
  • 7
  • 17
5
votes
2 answers

View-based NSOutlineView header cell font issues

I'm currently trying to use a new view-based NSOutlineView in my Cocoa app. As I'm not using bindings, so I implemented all required delegate and datasource methods in my controller. In interface builder I've added a NSOutlineView with a…
BinaryBucks
  • 976
  • 7
  • 17
5
votes
1 answer

Implementing a basic Source List using NSOutlineView and NSTableCellView

I am new to Cocoa, but am an experienced programmer (mostly C, C++, .NET and QT). I am working on implementing a Source List which is the sidebar you typically see in finder and iTunes. I am attempting to do so using a very basic test case. So no…
Rian Quinn
  • 51
  • 3
5
votes
0 answers

NSOutlineView drag and drop with security scoped URL fails when using NSPasteboardItem

I've an NSOutlineView that contains URL's as items. These URL's are security scoped and I want them to be able to be dragged to other applications. When I just return the URL (item) in func outlineView(_ outlineView: NSOutlineView,…
Remco Poelstra
  • 859
  • 6
  • 20
5
votes
0 answers

How to implement Sidebar for macOS in Swift?

I'm trying to implement a sidebar like the one used in the macOS Notes app. I've got the storyboard and sidebar working. But how can I implement the content window / detail view on the right? I want to show something based on the selection made in…
frankwolffnl
  • 129
  • 1
  • 8
5
votes
2 answers

NSOutlineView with transparent field editor

I'm working with a NSOutlineView located on a HUD panel. I configured it so that it doesn't draw its background. Everything looks fine until I double click to edit a cell. The field editor draws its background and focus ring which completely ruin…
Etabubu
  • 53
  • 4
5
votes
0 answers

Disclosure buttons missing in code only NSOutlineView

I'm attempting to construct code-only NSOutlineView in Swift playground, and I'm coming to grief trying to display the disclosure buttons. At the moment the result looks like this: But I am expecting something more like this: Here's the code I…
Chui Tey
  • 5,436
  • 2
  • 35
  • 44
5
votes
4 answers

Expanding all items of a NSOutlineView that loads data from a data source

First of all I'm new to cocoa development so I suppose I'm probably trying to do this the wrong way, but here goes: I have a NSOutlineView which loads the data from a NSOutlineViewDataSource implementation. I want all the items to be expanded after…
matei
  • 8,465
  • 1
  • 17
  • 15
5
votes
4 answers

NSOutlineView doesn't Collapse Item

I have a NSOutlineView, and clicking on a row will expand/collapse the item if it's expandable. if ([self.outlineView isItemExpanded:item]) { NSLog("Will collapse item : %@", item); [[self.outlineView animator]…
Jensen
  • 1,653
  • 4
  • 26
  • 42
5
votes
1 answer

Dynamic NSOutlineView data source

So I have implemented a PXSourceList data source that pretty much is a duplicate of Apple's example of a NSOutlineView data source. This is how it goes... - (NSUInteger)sourceList:(PXSourceList*)sourceList numberOfChildrenOfItem:(id)item; { if…
Souljacker
  • 774
  • 1
  • 13
  • 35
5
votes
2 answers

NSOutlineView expand / collapse animation from code

i'm wondering how does one animate the expansion/collapse of an NSOutlineView's tree node from code ? // this works ok but doesn't animate NSTreeNode *node = [self.outlineView itemAtRow:self.outlineView.clickedRow]; if([self.outlineView…
Nightbirdsevolve
  • 562
  • 5
  • 15
5
votes
2 answers

NSOutlineView source list style, view based, change font

I'm using an NSOutlineView with source list style, and using the view based (rather than cell based) outline view. I would like to be able to make some rows bold. However, my attempts to change the font (manually in IB, through code in…
Amy Worrall
  • 16,250
  • 3
  • 42
  • 65
5
votes
2 answers

How to keep the last tree item of NSOutlineView in the most bottom of a Sidebar?

I'd like to have the same behavior of special items as it's done in the Things application. I mean Logbook and Trash items in the bottom part of the Sidebar: Logbook and Trash items are in the most bottom http://tinyurl.com/lhctza Please advise any…
Vadim
  • 9,383
  • 7
  • 36
  • 58
5
votes
1 answer

View-based “Source List” NSOutlineView not display icons and titles of the items

After changing NSOutlineView cell-based to view-based, it's not display the icons and titles of file-system tree. Here my code: - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn…
jazz man
  • 117
  • 2
  • 7