# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1308881445 0 # Node ID 6ca1132a240ecf9c08b061debb7e5e768a580d9a # Parent 2accf180bcfe50edd9f3c65970ef305805828a57 Allow tree nodes without icons using the new NSMutableArray tree code on Mac. diff -r 2accf180bcfe -r 6ca1132a240e mac/dw.m --- a/mac/dw.m Tue Jun 14 13:38:55 2011 +0000 +++ b/mac/dw.m Fri Jun 24 02:10:45 2011 +0000 @@ -1763,7 +1763,8 @@ { NSMutableArray *this = (NSMutableArray *)item; NSImage *img = [this objectAtIndex:0]; - [(NSBrowserCell*)cell setImage:img]; + if([img isKindOfClass:[NSImage class]]) + [(NSBrowserCell*)cell setImage:img]; } } -(BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item { return NO; } @@ -5028,7 +5029,10 @@ DWTree *tree = handle; NSString *nstr = [[NSString stringWithUTF8String:title] retain]; NSMutableArray *treenode = [[[NSMutableArray alloc] init] retain]; - [treenode addObject:icon]; + if(icon) + [treenode addObject:icon]; + else + [treenode addObject:[NSNull null]]; [treenode addObject:nstr]; [treenode addObject:[NSValue valueWithPointer:itemdata]]; [treenode addObject:[NSNull null]];