Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 11, 2009, 05:39 PM   #1
BollywooD
macrumors 6502
 
Join Date: Apr 2005
[cell setTransparent] in NSOutlineView

I am using this method to hide the disclosure triangle, in nonexpandable items in an NSOutlineView:

Code:
- (void)outlineView:(NSOutlineView *)theOutlineView willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
	if ([item count] == 0)
        [cell setTransparent:YES];
	else
        [cell setTransparent:NO];
}
it does what i want, but slows the OutlineView down to a crawl. Is there a better way to implement this?
I only want a disclosure triangle shown for expandable items... not every item in my OutlineView.

thanks in advance

<edit>Should mention, I am using NSTreeController for the Datasource</edit>

Last edited by BollywooD; Apr 11, 2009 at 05:54 PM.
BollywooD is offline   0 Reply With Quote
Old Apr 13, 2009, 07:02 AM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
I've never used NSTreeController before, but try implementing an isLeaf method in your object. From the docs:
Quote:
You can optionally provide a leaf key path that specifies a key in your model object that returns YES if the object is a leaf node, and NO if it is not. Providing this key path prevents the NSTreeController from having to determine if a child object is a leaf node by examining the child object and as a result improve performance.
Edit: if you're targeting 10.5+ with your app, it might help to make your node objects a subclass of NSTreeNode.
kainjow is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
overriding mouseup in NSOutlineView Subclass McBgnr Mac Programming 1 Nov 13, 2009 09:51 AM
Numbers: cell references in cell references PCheese Mac Applications and Mac App Store 3 Oct 13, 2009 09:25 PM
Checkbox in NSOutlineView mahaboob Mac Programming 0 Sep 9, 2008 11:23 PM
cell phones in chicago! greatm31 Buying Tips, Advice and Discussion (archive) 13 Aug 2, 2004 05:52 PM
Suggestions for a New Cell Phone in VA GorillaPaws Buying Tips, Advice and Discussion (archive) 1 May 5, 2004 01:59 PM


All times are GMT -5. The time now is 12:26 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC