• 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: NSTableView && Custom Background ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView && Custom Background ...


  • Subject: Re: NSTableView && Custom Background ...
  • From: Mic Pringle <email@hidden>
  • Date: Thu, 26 Feb 2009 17:07:14 +0000

The combination of using notifications and invalidating the view works
just as I desired.

Thankyou for you help.

-Mic

2009/2/26 Corbin Dunn <email@hidden>:
>
> On Feb 26, 2009, at 1:09 AM, Mic Pringle wrote:
>
>> 2009/2/25 Corbin Dunn <email@hidden>:
>>>
>>> On Feb 25, 2009, at 2:58 PM, Mic Pringle wrote:
>>>
>>>> Hi,
>>>>
>>>> I've a subclass of NSTableView that draws a custom gradient
>>>> background. What I'd like to do now is to draw a slightly different
>>>> background when the window containing the custom NSTableView loses
>>>> focus.
>>>>
>>>> Is this possible ?
>>>>
>>>> If so, could someone please point me in the right direction ?
>>>>
>>>> I know that in the NSTableView subclass you can use [self window] to
>>>> get the containing window, so I have tried things like [[self window]
>>>> isKeyWindow] and [[self window] isMainWindow] but this doesn't seem to
>>>> get me anywhere.
>>>
>>> In addition to what Nick said, you probably aren't invalidating the
>>> tableview when the window looses/gains key status.
>>>
>>> What you want to do does work, and is possible; the
>>> NSTableViewSourceListHighlightStyle does this automatically.
>>>
>>> corbin
>>>
>>>
>>>
>>
>> Hi Corbin,
>>
>> I understand what Nick suggested and will look into it, but don't
>> quite understand what you mean by invalidating the tableview. Could
>> you give me a little more information ?
>
> You will want to call [tableView setNeedsDisplay:YES] to get it to redraw
> its custom background. You'll want to do this inside the notifications for
> the window gaining/loosing key. That is all I meant.
>
> corbin
>
>
_______________________________________________

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

References: 
 >NSTableView && Custom Background ... (From: Mic Pringle <email@hidden>)
 >Re: NSTableView && Custom Background ... (From: Corbin Dunn <email@hidden>)
 >Re: NSTableView && Custom Background ... (From: Mic Pringle <email@hidden>)
 >Re: NSTableView && Custom Background ... (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: Select tablecell on creation through arrayController
  • Next by Date: NSLayoutManager for NSTextField (was Re: Metrics for a NSTextField)
  • Previous by thread: Re: NSTableView && Custom Background ...
  • Next by thread: Re: NSTableView && Custom Background ...
  • Index(es):
    • Date
    • Thread