Re: Image in place of NSTableColumn header cell
Re: Image in place of NSTableColumn header cell
- Subject: Re: Image in place of NSTableColumn header cell
- From: PGM <email@hidden>
- Date: Fri, 15 Sep 2006 20:54:07 -0400
If you have any instance variables for your NSTableHeaderCell
subclass, also be sure to implement copyWithZone , otherwise you get
problems with the "ghost" column that appears at the end of the table
if all columns are not wide enough to fill the view. Also keep in
mind that this "ghost" column always takes the headerCell of the last
real column.
Patrick
On 15-Sep-06, at 19:52 PM, Philip Dow wrote:
Hi Brian,
You can do this without a subclass of NSTableColumn. Subclass
NSTableHeaderCell instead and override drawWithFrame:inView:. When
you do that you'll need to call
drawSortIndicatorWithFrame:inView:ascending:priority: and
drawInteriorWithFrame:inView: from within your method.
Figuring out if the sort descriptor for a particular cell is active
and ascending or descending can be tricky, but as far as I can
tell, you need to know this so you can pass the right data to the
draw indicator method.
If you just need one table column is using this cell, set up an
NSTableColumn IBOutlet and call setHeaderCell: on it in
awakeFromNib. If all of the column headers should use this cell,
it's easier to iterate through an array of the table's columns,
happily provided by NSTableView's tableColumns method.
-Phil
On Sep 16, 2006, at 1:38 AM, Brian Amerige wrote:
Hi all,
I've been browsing around, and just looking for a way to put a
(repeating, x-axis) image in place of an NSTableColumn header cell.
So far (from what I could figure out) I've got a subclass of
NSTableColumn, with a setHeaderCell method (which essentially does
nothing at this point).
Any guidance is appreciated!
Brian Amerige
http://extendmac.com
http://cocoaforum.com
_______________________________________________
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40sympatico.ca
This email sent to email@hidden
_______________________________________________
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