Re: Displaying 2 images in a single cell of nstableview
Re: Displaying 2 images in a single cell of nstableview
- Subject: Re: Displaying 2 images in a single cell of nstableview
- From: "vibhatha v" <email@hidden>
- Date: Fri, 8 Dec 2006 19:31:32 +0530
Thanks a lot for the suggestions.
If i create a NSCell subclass, and draw the images using,
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
NSImage *attachmentImage = [NSImage imageNamed: @"Attachments16"];
NSImage *commentstImage = [NSImage imageNamed: @"Comments"];
float clockRadius = MIN(NSHeight(cellFrame), (NSWidth(cellFrame)/2));
[attachmentImage drawInRect:NSMakeRect(NSMinX(cellFrame),
NSMinY(cellFrame),clockRadius,clockRadius)
fromRect:NSMakeRect(0,0,[attachmentImage size].width, [attachmentImage
size].height) operation:NSCompositeSourceOver fraction:1.0];
[commentstImage drawInRect:NSMakeRect(NSMinX(cellFrame) +
(NSWidth(cellFrame)/2), NSMinY(cellFrame),clockRadius,clockRadius)
fromRect:NSMakeRect(0,0,[commentstImage size].width, [commentstImage
size].height) operation:NSCompositeSourceOver fraction:1.0];
}
Here, i need different images in different table cells.
But in this case i can use this as,
[[tableView1 tableColumnWithIdentifier:@"table_identifier"]
setDataCell:[[[CustomCellClass alloc] init] autorelease]];
When i do this, the same images are applied to all the table column cells.
How can i manipulate the code so that i can get different images in
different table column cells?
Any suggestions would be highly appreciated.
Thanks and Regards,
Vibhatha.
On 12/8/06, Nir Soffer <email@hidden> wrote:
Create a NSCell subclass, and draw those 2 (or 20) images in its
drawWithFrame:inView: method.
You can see example code in
file://localhost/Developer/Examples/AppKit/ClockControl
On Dec 7, 2006, at 16:18, vibhatha v wrote:
Hi,
i have to display 2 images in a single cell of an nstableview.
To display 1 image i am using tableview willdisplay cell function.
Any suggestions as to how can display 2 images in a single table cell?
Thanks and Regards,
Vibhatha.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Best Regards,
Nir Soffer
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden