Different NSCells in an NSOutlineView
Different NSCells in an NSOutlineView
- Subject: Different NSCells in an NSOutlineView
- From: malcom <email@hidden>
- Date: Thu, 20 Oct 2005 00:50:21 +0200
Hi,
I have created an NSOutlineView class with a custom cell class attached.
I've used this instructions to provide a custom class:
myCell = [[[myCustomCellClass alloc] init] autorelease];
[myCell setEditable: YES];
[[myOutlineView outlineTableColumn] setDataCell: myCell];
All works fine but now I would to use two different kind of NSCell
inside my OutlineView. Is this possible? And how? (anyone can provide
a short example or link to a project example).
I have another question. To make my custom NSCell class I've used the
instructions in ImageAndTextCell of DragNDropOutlineView of ADC
Examples. I have added a new line
with this instruction inside - (void)drawWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView:
[@"my subtitle text" drawInRect:NSMakeRect(38,14,50,40) withAttributes:
[NSDictionary dictionaryWithObjectsAndKeys: [NSFont
fontWithName:@"Lucida Grande" size:9],
NSFontAttributeName,
[NSColor grayColor],
NSForegroundColorAttributeName,
nil, nil]];
Unfortunatly when I select the row the 'subtitle' text does not appear
anymore. Why?
(main text will be returned by a return @STRING into -
(id)outlineView:(NSOutlineView *)outlineView
objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
of my NSOutlineView).
Thank you very much.
Malcolm
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden