• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get a table column header with an image instead of text?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get a table column header with an image instead of text?


  • Subject: Re: How to get a table column header with an image instead of text?
  • From: Marc Respass <email@hidden>
  • Date: Sun, 20 Jul 2008 13:54:12 -0400

Hi again,

I hate answering my own question but I did figure it out. I sub- classed NSTableHeaderCell then created an instance using initImageCell. Then it occurred to me that it seemed a bit silly. If I can init an image cell, maybe I can just set the cell. So, create an outlet to the column (or find it somehow) and in awakeFromNib,

NSImage *image = [NSImage imageNamed:@"CellImage"];
[[theColumn headerCell] setImage:image];

Now to figure out how to prevent the sort indicator from displaying :).

Thanks
Marc

On Jul 20, 2008, at 1:38 PM, Marc Respass wrote:

Hi All,

I have run a number of searches and cannot find any documentation nor examples for putting an image in a table column header. I tried setting the table header column cell to an NSImageCell but that failed fabulously. It seems that I need to sub-class NSTableHeaderCell and draw the image myself instead of text. Can anyone point me in the right direction? Subclassing is fun, no doubt, but if there's a better way, I haven't found it so that's the path I'm planning to take.

Thanks a lot
Marc
_______________________________________________

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

_______________________________________________

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


  • Follow-Ups:
    • Re: How to get a table column header with an image instead of text?
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >How to get a table column header with an image instead of text? (From: Marc Respass <email@hidden>)

  • Prev by Date: How to get a table column header with an image instead of text?
  • Next by Date: looking for help with http post example
  • Previous by thread: How to get a table column header with an image instead of text?
  • Next by thread: Re: How to get a table column header with an image instead of text?
  • Index(es):
    • Date
    • Thread