Center image in NSTableView header
Center image in NSTableView header
- Subject: Center image in NSTableView header
- From: Ivan C Myrvold <email@hidden>
- Date: Thu, 15 Jan 2009 07:17:00 +0100
I am creating an NSAttributedString containing an image in an
NSTextAttachment, setting an NSTableView headerCell to the
attachmentCell.
This works great, the image is shown nicely on the table view column
header.
But I am unable to get the image centered in the column header. Anyone
have a hint to how I can do that?
Here is my code:
NSImage *warningImage = [NSImage imageNamed:@"danger"];
NSTextAttachment *ta = [[[NSTextAttachment alloc] init] autorelease];
[(NSCell *)[ta attachmentCell] setImage:warningImage];
NSAttributedString *headerAS = [NSAttributedString
attributedStringWithAttachment:ta];
[[[oactiveElementsTable tableColumnWithIdentifier:@"warningword"]
headerCell] setAttributedStringValue:headerAS];
Ivan
_______________________________________________
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