0

Is there a way to build a file tree using Cappuccino with collapsible nodes?

1 Answers1

1

Yes, it's called a CPOutlineView.

You can supply a custom dataview which will allow you to display an icon right next to your text just like the finder does.

Me1000
  • 1,760
  • 1
  • 12
  • 14
  • Thanks, it would be great if you could provide a code sample too. – Amarnath Ravikumar Jan 28 '11 at 11:12
  • Just like you create any other view var ov = [[CPOutlineView alloc] initWithFrame:CGRectMakeZero()]; // since you are adding to it a scrollview you dont need a real frame, it will be size correctly when you add it… then you will need to create a column. var col = [[CPTableColumn] initWithIdentifier:"my cool column"]; Then supply a custom dataview: [col setDataView:myDataView]; (see the docs on that since it requires you to implement CPCoding) add it to the ov [ov addTableColumn:col]; it's about as simple as that. – Me1000 Jan 29 '11 at 23:50