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
mario.kusn...@sb.t-com.hr
+385957051982
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com