Image ToolTips in TableView revisited
Image ToolTips in TableView revisited
- Subject: Image ToolTips in TableView revisited
- From: rajesh <email@hidden>
- Date: Wed, 17 Dec 2008 12:40:04 +0100
Hi all,
I was trying to display the image tool tip for few columns in the
NSOutLineView
Luckily my deployment target is 10.5+
This is what I did in my custom cell class
- (NSRect)expansionFrameWithFrame:(NSRect)cellFrame inView:(NSView
*)view
{
NSRect rect = [self calulateRectProportion:cellFrame scale:YES]; //
my stuff to resize the tooltip
return NSMakeRect(rect.origin.x + koffset, rect.origin.y + koffset,
rect.size.width,rect.size.height); // move tooltip with some offset
}
- (void)drawWithExpansionFrame:(NSRect)cellFrame inView:(NSView *)view
{
[super drawWithExpansionFrame:cellFrame inView:view];
[previewImage setSize:cellFrame.size];
[previewImage setFlipped:[view isFlipped]];
[previewImage drawInRect:cellFrame fromRect:NSZeroRect
operation:NSCompositeCopy fraction:1.0];
}
This works like a charm compared with the pain using 10.4 SDK's
does this look like some patch work ? or is there a better way ?
Thanks
Rajesh
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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