Re: Current -in-drawing NSCell (NSOutlineView)
Re: Current -in-drawing NSCell (NSOutlineView)
- Subject: Re: Current -in-drawing NSCell (NSOutlineView)
- From: malcom <email@hidden>
- Date: Tue, 25 Oct 2005 23:47:02 +0200
I've used
- (void)outlineView:(NSOutlineView *)outlineView
willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn
item:(id)item {
int type = [(NGSidebarObject *)item getType];
switch (type) {
case SIDEBAR_GROUP: {
[cell setTitle: [item getParamValueForKey:@"NAME"]
andSubTitle: @"42 unreads"
withIcon: groupImage
forType: type];
break;
} // other switch cases
}
Unfortunatly all changes was applied to the first NSCell into the
list. The other NSCell objects still remain empty and nothing was
drawed into it.
Where is the problem?!
PS:
In awakeFromNib of my OutlineView class:
- (void) awakeFromNib {
imageAndTextCell = [[[MWSidebarCell alloc] init] autorelease];
[[sideBarView outlineTableColumn] setDataCell:imageAndTextCell];
}
and my NSCell class suppots copying:
- copyWithZone:(NSZone *)zone {
MWSidebarCell *cell = (MWSidebarCell *)[super copyWithZone:zone];
cell->image = [image retain];
cell->_title = [_title retain];
cell->_subtitle = [_subtitle retain];
return cell;
}
2005/10/25, malcom <email@hidden>:
> hi, I'm working with custom NSCell class in an NSOutlineView. I would
> to call a custom method of my NSCell class at each cell drawing
> events. I have found this method
> - (id)outlineView:(NSOutlineView *)outlineView
> objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
> but it does not contains the current in-drawing cell so I can't call
> the method for this particular istance of NSCell.
> What's the right method?
> Thanx
>
--
www.malcom-mac.com
mac/win/linux custom software development
_______________________________________________
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