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
6
votes
3 answers

rearranging table rows by dragging in Lion

I am having trouble using the new Lion functionality to rearrange rows in my app. I am using outlineView:pasteboardWriterForItem: to store the row indexes so that I can access them later when I validate/accept the drop. I create a new…
livings124
  • 1,103
  • 1
  • 10
  • 23
6
votes
3 answers

NSTextField not calling delegate when inside an NSTableCellView

I have a fairly vanilla Source List (dragged out from the Object Library) in my app, with an NSTreeController as its data source. I set the NSTextField inside the DataCell to be editable, but I want to be able to turn that off for some cells. The…
Dov
  • 15,530
  • 13
  • 76
  • 177
6
votes
2 answers

NSOutlineView indentation issue

I'm using an NSOutlineView object to represent a file structure and am finding that it will not correctly indent any children which are expandable, though it will indent children that aren't. Here's a picture to show what I mean: In this example,…
Gary
  • 926
  • 3
  • 12
  • 24
6
votes
2 answers

NSTextFieldCell with Multiple Lines

I need to show an NSTextFieldCell with multiple lines with different format on each line. Something like this: Line 1: Title Line 2: Description I subclassed NSTextFieldCell but I don't know how to go on with it. Any ideas?
mikywan
  • 1,495
  • 1
  • 19
  • 38
6
votes
2 answers

set NSOutlineView's selection programmatically (and get NSTableView's selection)

I want to set my OutlineView's selection programmatically in another class. I'm able to acces the instance of NSOutlineView by [[appDelegate outlineViewController] outlineView]. The idea behind this, is that I have a view with a list of items (that…
Mikk Rätsep
  • 512
  • 7
  • 20
6
votes
1 answer

Reset Core Data driven treeController content

I run my program that creates Core Data content that is displayed in a NSOutlineView using NSTreeController. The second time I run my program I want to clean the content of my NSTreeController and I run the method pasted below. The method either…
Trond Kristiansen
  • 2,379
  • 23
  • 48
6
votes
3 answers

NSVisualEffectView behind NSScrollView

I'm trying to get my NSScrollView (and thus a contained NSOutlineView) to use a blurred NSVisualEffectView with behind-window blending effect. I've successfully made NSVisualEffectView the container view and placed my scroll view as a subview. This…
6
votes
1 answer

How to autosize columns in a view-based NSTableView or NSOutlineView

What is required to support the column autosize request for a view-based table? The docs are really unclear on this point, and seem to speak to cell-based views. This is to handle a double click on a column separator. I can make this work by…
jeberle
  • 718
  • 3
  • 15
6
votes
1 answer

Difference Between NSOutlineView and NSTableView

Tell me the difference between NSOutlineView and view based NSTableview as I know view based table view may not contain tree controller and NSOutlineView can have tree controller object is it true or wrong
Snehal Tanawade
  • 139
  • 1
  • 9
6
votes
2 answers

How to access the text of a particular row of an outline control with AppleScript?

I'm trying to select a particular row of an outline using AppleScript, based on its text. Here's what I'm considering (but doesn't work): repeat with aRow in rows of outline 1 of scroll area 1 of splitter group 1 of window 1 set t to text of…
ptrico
  • 1,049
  • 7
  • 22
6
votes
1 answer

Shaving a couple levels of indentation off of an NSOutlineView

I have an outline view where I don't want to indent the top couple levels (they have a distinctive appearance anyway), but I do want to indent subsequent levels. How can I do this? I've tried overriding -levelForRow: and -levelForItem: to subtract 2…
Becca Royal-Gordon
  • 17,541
  • 7
  • 56
  • 91
6
votes
4 answers

Contextual menu on only certain items in a "Source List"

I have a window with a Source List (NSOutlineView). My source list has just two levels. Level one is header and level two is data. I want to have a contextual menu on some of the data cells. Not all. First, I try to attach a menu on the table cell…
Olof
  • 524
  • 5
  • 20
6
votes
2 answers

Creating a simple NSOutlineView datasource with MonoMac

I cant seem to figure out how to create a simple NSOutlineView with 2 columns, and a datastructure that is more than 1 level deep (a hierachy). I've been researching this for days, and all I can find is Objective C examples, which I really can't use…
Jeff
  • 12,085
  • 12
  • 82
  • 152
6
votes
1 answer

Custom sections for enumerated objects of array in NSOutlineView

I am trying to create a NSOutlineVew with a custom header group (parent node) for listed objects. (NOTE: I have cell-based NSOutlineView). For example it look like as the Xcode "Navigator" or Numbers sidebar. I used the default groups for the…
jazz man
  • 117
  • 2
  • 7
5
votes
1 answer

outlineView:objectValueForTableColumn:byItem: not called

I'm trying to create a source list for a new program and I'm having a little issue using a view-based NSOutlineView. My code works fine using a cell-based NSOutlineView so I'm a little confused about what is happening. Here is my code for the…
John Barnes
  • 67
  • 1
  • 7
1 2
3
43 44