Re: Is it possible to set an NSTableView cell background color?
Re: Is it possible to set an NSTableView cell background color?
- Subject: Re: Is it possible to set an NSTableView cell background color?
- From: David Delmonte <email@hidden>
- Date: Thu, 23 Feb 2017 17:15:26 -0500
I worked the problem. I’m rather rusty these days.
This is what I came up with:
1. Moved to view-based table view.
2. In viewForRow, I added this line:
cell.memoryName.drawsBackground = true
3. And then:
cell.memoryName.backgroundColor = mintGreen
Thanks to all for the pointers.
> On Feb 23, 2017, at 5:11 PM, corbin dunn <email@hidden> wrote:
>
>
>> On Feb 22, 2017, at 6:27 PM, David Delmonte <email@hidden> wrote:
>>
>> I tried you solution but it doesn’t color the cell. Scratching my head some more.. I’ll probably ask on Stack Overflow.
>
> How did you get it to compile? It requires a view based tableview. Your first step is to convert to a view based tableview.
>
> corbin
>
>>
>>
>>> On Feb 22, 2017, at 8:37 PM, Saagar Jha <email@hidden> wrote:
>>>
>>> Well, assuming you have a NSTableCellView, you can set its background color using its layer. For example:
>>>
>>> cell.layer.backgroundColor = NSColor.black.cgColor
>>>
>>> Saagar Jha
>>>
>>>> On Feb 22, 2017, at 16:14, David Delmonte <email@hidden <mailto:email@hidden>> wrote:
>>>>
>>>> Hi all, I have a table that has records by date. I want to color those entries based on the decade.
>>>>
>>>> I cannot seem to find a way to do this.
>>>>
>>>> Any help would be appreciated.
>>>>
>>>> David
>>>> _______________________________________________
>
_______________________________________________
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