Re: Appropriate -setWantsLayer: timing

2010-02-19 Thread Simon Wolf
On 19 Feb 2010, at 03:50, Scott Anguish wrote: > > On Feb 16, 2010, at 5:45 PM, Simon Wolf wrote: > >>> >>> I'm wondering when writing a layer hosting view, when the most appropriate >>> time is to set the layer and call -setWantsLayer:YES? >>> >>> Calling it in -initWithFrame: is too early a

Re: Appropriate -setWantsLayer: timing

2010-02-19 Thread Matt Neuburg
On Wed, 17 Feb 2010 17:07:54 -1000, Dave Keck said: >> Maybe I'm misunderstanding, but I'm wondering, why not put everything into a >> single method and call that method from both initWithFrame and awakeFromNib? >> One and only one of these will be called (depending whether you are >> instantiatin

Re: Appropriate -setWantsLayer: timing

2010-02-18 Thread Scott Anguish
On Feb 16, 2010, at 5:45 PM, Simon Wolf wrote: >> >> I'm wondering when writing a layer hosting view, when the most appropriate >> time is to set the layer and call -setWantsLayer:YES? >> >> Calling it in -initWithFrame: is too early and the view fails to 'draw'. > > In addition to David's r

Re: Appropriate -setWantsLayer: timing

2010-02-18 Thread Simon Wolf
On 17 Feb 2010, at 09:23, Keith Duncan wrote: > > On 16 Feb 2010, at 21:40, David Duncan wrote: > >>> Calling it in -initWithFrame: is too early and the view fails to 'draw'. >> >> If you are creating the view programmatically, -initWithFrame: should be >> fine. If your loading from a nib, the

Re: Appropriate -setWantsLayer: timing

2010-02-18 Thread Simon Wolf
Hi Keith, In addition to David's reply, a small tip is that you can also get things working if you call setWantsLayer: and then follow it by assigning a layer: [self setWantsLayer:YES]; [self setLayer:[CALayer layer]]; Otherwise the layer is added at some undetermined future point which may not

Re: Appropriate -setWantsLayer: timing

2010-02-17 Thread Michael Ash
On Wed, Feb 17, 2010 at 4:23 AM, Keith Duncan wrote: > > On 16 Feb 2010, at 21:40, David Duncan wrote: > >>> Calling it in -initWithFrame: is too early and the view fails to 'draw'. >> >> If you are creating the view programmatically, -initWithFrame: should be >> fine. If your loading from a nib,

Re: Appropriate -setWantsLayer: timing

2010-02-17 Thread Dave Keck
> Maybe I'm misunderstanding, but I'm wondering, why not put everything into a > single method and call that method from both initWithFrame and awakeFromNib? > One and only one of these will be called (depending whether you are > instantiating in code or in a nib), so your single method will be cal

Re: Appropriate -setWantsLayer: timing

2010-02-17 Thread Dave Keck
> That's actually a more distilled version of my question. When your layer > hosting view may be instantiated programatically, or from a NIB; there is no > good place that covers both since the -init methods are too early (I haven't > needed to test -initWithCoder: yet). > > Nor have I determine

Re: Appropriate -setWantsLayer: timing

2010-02-17 Thread Matt Neuburg
On Wed, 17 Feb 2010 09:23:57 +, Keith Duncan said: > >On 16 Feb 2010, at 21:40, David Duncan wrote: > >>> Calling it in -initWithFrame: is too early and the view fails to 'draw'. >> >> If you are creating the view programmatically, -initWithFrame: should be fine. If your loading from a nib, t

Re: Appropriate -setWantsLayer: timing

2010-02-17 Thread Keith Duncan
On 16 Feb 2010, at 21:40, David Duncan wrote: >> Calling it in -initWithFrame: is too early and the view fails to 'draw'. > > If you are creating the view programmatically, -initWithFrame: should be > fine. If your loading from a nib, then -awakeFromNib is the appropriate place. That's actuall

Re: Appropriate -setWantsLayer: timing

2010-02-16 Thread David Duncan
On Feb 16, 2010, at 12:52 PM, Keith Duncan wrote: > I'm wondering when writing a layer hosting view, when the most appropriate > time is to set the layer and call -setWantsLayer:YES? > > Calling it in -initWithFrame: is too early and the view fails to 'draw'. If you are creating the view progr

Appropriate -setWantsLayer: timing

2010-02-16 Thread Keith Duncan
I'm wondering when writing a layer hosting view, when the most appropriate time is to set the layer and call -setWantsLayer:YES? Calling it in -initWithFrame: is too early and the view fails to 'draw'. Keith ___ Cocoa-dev mailing list (Cocoa-dev@lists