« rail unicycle riding at East Cliff Rd, Santa Cruz, CA (aka: 'the hook') | Main | Finding memory leaks with Object Alloc »
June 15, 2005
Changing the disclosure triangle in an NSOutlineView
At WWDC I was asked how to remove the disclosure triangle in an NSOutlineView. Well, first things first. You can change it with this bit of code in your delegate:
- (void)outlineView:(NSOutlineView *)ov
willDisplayOutlineCell:(NSButtonCell *)cell
forTableColumn:(NSTableColumn *)tableColumn
item:(id)item
{
[cell setImage:[NSImage imageNamed:@"collapsedglyph.tiff"]];
[cell setAlternateImage:[NSImage imageNamed:@"expandedglyph.tiff"]];
}
If you want to set it to nil, you will have to create an image that is empty.
--corbin
Posted by corbin at June 15, 2005 05:47 PM