• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSOutlineView - How to hide disclosure triangle for root nodes ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSOutlineView - How to hide disclosure triangle for root nodes ? (From: Mario Kušnjer <email@hidden>)
 >Re: NSOutlineView - How to hide disclosure triangle for root nodes ? (From: Jens Alfke <email@hidden>)
 >Re: NSOutlineView - How to hide disclosure triangle for root nodes ? (From: Mario Kušnjer <email@hidden>)
 >Re: NSOutlineView - How to hide disclosure triangle for root nodes ? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: NSOutlineView - How to hide disclosure triangle for root nodes ? (From: Mario Kušnjer <email@hidden>)
 >Re: NSOutlineView - How to hide disclosure triangle for root nodes ? (From: Jim Puls <email@hidden>)

  • Prev by Date: Looking for PCI card with IR transmitter ports and OS X drivers
  • Next by Date: Problem with same DeviceID for input and output for Playback
  • Previous by thread: Re: NSOutlineView - How to hide disclosure triangle for root nodes ?
  • Next by thread: Re: NSOutlineView - How to hide disclosure triangle for root nodes ?
  • Index(es):
    • Date
    • Thread