Re: needsDisplay and subviews

2017-03-10 Thread Jeremy Hughes
> On 9 Mar 2017, at 18:32, corbin dunn wrote: > >> >> On Mar 8, 2017, at 8:46 AM, Jeremy Hughes >> wrote: >> >> If needsDisplay is set to true for an NSView, does that also cause subviews >> to be redrawn? >> >> I’ve seen conflicting statements about this, but haven’t found anything in >>

Re: needsDisplay and subviews

2017-03-09 Thread corbin dunn
> On Mar 8, 2017, at 8:46 AM, Jeremy Hughes wrote: > > If needsDisplay is set to true for an NSView, does that also cause subviews > to be redrawn? > > I’ve seen conflicting statements about this, but haven’t found anything in > Apple’s documentation. Just to be clear: if you want a view to

Re: needsDisplay and subviews

2017-03-09 Thread Quincey Morris
On Mar 9, 2017, at 02:24 , Jeremy Hughes wrote: > > that disagrees with Ben’s conclusion: > > "Thus, it seems to follow that so long a custom view's display() calls super, > then all of its subviews should also be drawn when its needsDisplay is true.” I don’t see it as a contradiction. The pro

Re: needsDisplay and subviews

2017-03-09 Thread Jeremy Hughes
> On 9 Mar 2017, at 10:24, Jeremy Hughes wrote: > > So it seems that for layer-backed views, setting needsDisplay does cause the > view to be redrawn - but the value is never actually set. If I needed to work > with layer-backed views, it might be possible to get around this by > overriding wi

Re: needsDisplay and subviews

2017-03-09 Thread Jeremy Hughes
> On 9 Mar 2017, at 01:49, Quincey Morris > wrote: > > So, the correct answer to your original question, I think, is that if your > model data has changed in such a way that the representation in custom views > no longer reflects the data, then you should set “needsDisplay” on *every* > custo

Re: needsDisplay and subviews

2017-03-08 Thread Quincey Morris
On Mar 8, 2017, at 15:25 , Jeremy Hughes wrote: > > My conclusion (for now) is that “needsDisplay” causes subviews to be redrawn > - except when “wantsLayer” has been set to true. > > Does that make sense? Sure. In some cases, such as when using layers, the result of your “draw(_:)” methods f

Re: needsDisplay and subviews

2017-03-08 Thread Jeremy Hughes
The situation in which subviews were not being redrawn seems to have been a xib problem. After spending some time getting nowhere I decided to recreate the xib by taking a different xib (which used the same custom view) and cutting it down. This worked without any problems. Then I compared the t

Re: needsDisplay and subviews

2017-03-08 Thread Ben Kennedy
> On 08 Mar 2017, at 8:46 am, Jeremy Hughes wrote: > > If needsDisplay is set to true for an NSView, does that also cause subviews > to be redrawn? Admittedly I've been mostly doing iOS development for the last several years and barely any Mac lately, but, according to the current docs: need

needsDisplay and subviews

2017-03-08 Thread Jeremy Hughes
If needsDisplay is set to true for an NSView, does that also cause subviews to be redrawn? I’ve seen conflicting statements about this, but haven’t found anything in Apple’s documentation. Jeremy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co