Re: NSOutlineView - How to hide disclosure triangle for root nodes ?
Re: NSOutlineView - How to hide disclosure triangle for root nodes ?
- Subject: Re: NSOutlineView - How to hide disclosure triangle for root nodes ?
- From: Mario Kušnjer <email@hidden>
- Date: Thu, 26 Nov 2009 04:39:45 +0100
Here's me again !
So I have found a different solution for my problem and it does not
include subclassing NSOutlineView,
but trough the use of two delegate method.
This is my implementation:
- (NSCell *)outlineView:(NSOutlineView *)outlineView
dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item {
[outlineView rowForItem:item] == 0 ? [outlineView
setIndentationPerLevel:0.0] : [outlineView setIndentationPerLevel:14.0];
return nil == tableColumn ? nil : [tableColumn dataCellForRow:
[outlineView rowForItem:item]];
}
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn
*)tableColumn item:(id)item {
[outlineView rowForItem:item] == 0 ? [cell setTransparent:YES] :
[cell setTransparent:NO];
}
To explain:
In both methods I ask if row in question is the root. If it is, than
set no indentation and hide triangle,
otherwise set some indentation and show the triangle.
I believe that this is better solution than subclassing.
Still I have some issues to resolve. Work in progress.
Thanks everyone for their suggestions. If anyone is interested in
reviewing my code,
the project is in zip archive at http://www.box.net/crowebster-public.
Bye.
Mario Kušnjer
email@hidden
+385957051982
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden