Re: Highlight color of a NSTableView row
Re: Highlight color of a NSTableView row
- Subject: Re: Highlight color of a NSTableView row
- From: Eric Gorr <email@hidden>
- Date: Sat, 12 Apr 2008 11:26:07 -0400
On Apr 11, 2008, at 11:42 AM, Corbin Dunn wrote:
On Apr 10, 2008, at 5:41 PM, Eric Gorr wrote:
On Apr 10, 2008, at 8:28 PM, Corbin Dunn wrote:
If you're targeting Leopard, there is an NSTableView method you
can override for this (a public one!)
-(void)highlightSelectionInClipRect:(NSRect)theClipRect
Ideally this should be the only method you have to override for
Tiger also. You may have to coordinate with the cell (or use a
custom cell) to get the cell to not draw a conflicting highlight
(hence, that is why some people say to override
_highlightColorForCell: -- this color isn't used by NSTableView --
it is used by the cell)
The only information I am displaying in the cells is text and, for
one column only, a NSImage. Does this mean I can avoid using a
custom cell?
If you want custom highlighting, unfortunately you need a custom cell.
Ok, I am working on this. But, while I do so, I have a quick
question...if one needs to use a custom cell if one wants custom
highlighting, then what is NSTableView's
'highlightSelectionInClipRect' function for or is the point that I
will still need to use this function in conjunction with a custom cell?
I'm insetting the rect of the entire row...there shouldn't be any
spaces between the columns, just some extra space left at the
beginning and end of the row.
Good point! I don't know what I was thinking -- that should work. If
you are seeing spaces between them, then it does sound like you
accidentally have grids turned on.
I don't have any code to turn the grids on and the Horizontal and
Vertical checkboxes for the Grid Lines are turn off in Interface
Builder.
Thanks again for your comments and help.
_______________________________________________
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