Re: resizing window containing NSView with CALayer

2011-08-08 Thread julius
On 7 Aug 2011, at 21:30, Kyle Sluder wrote: On Sun, Aug 7, 2011 at 1:05 PM, julius jul...@juliuspaintings.co.uk wrote: It is not a problem with the layers. I get exactly the same behaviour if I leave out all the layer stuff and instead code the following in the view Meaning, you still

Re: resizing window containing NSView with CALayer

2011-08-08 Thread julius
On 8 Aug 2011, at 01:46, Graham Cox wrote: On 08/08/2011, at 5:52 AM, julius wrote: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { I didn't notice first time through that this is where your code resides (sometimes the most obvious errors pass by when you're

Re: resizing window containing NSView with CALayer

2011-08-08 Thread Graham Cox
OK, I downloaded the project (tip: always get rid of the build folder before posting a project - it makes the difference between a 5 MB download and one that's only a few K, which on your server, added up to many minutes). Result - it works completely correctly and normally. The view resizes

Re: resizing window containing NSView with CALayer

2011-08-08 Thread julius
On 8 Aug 2011, at 11:23, Graham Cox wrote: OK, I downloaded the project (tip: always get rid of the build folder before posting a project - it makes the difference between a 5 MB download and one that's only a few K, which on your server, added up to many minutes). Sorry about that. Have

Re: resizing window containing NSView with CALayer

2011-08-08 Thread Graham Cox
On 08/08/2011, at 9:35 PM, julius wrote: When I go and drag the resize handle to make the window as small as I can make it, i.e. so the window's content rect has zero height then the view misbehaves, i.e. the top of the view shifts from being some 100 pixels below the title bar to being 0

Re: resizing window containing NSView with CALayer

2011-08-08 Thread Graham Cox
On 08/08/2011, at 10:42 PM, julius wrote: The reason this happens is that once either the width or height goes to 0, there's nothing for the view sizing code to mutliply by to end up with the destination size - once you hit a zero, the sizing information is lost. To prevent this, set a

Re: resizing window containing NSView with CALayer

2011-08-08 Thread julius
On 8 Aug 2011, at 14:00, Graham Cox wrote: Doing it this way should make your layer immune from the zero size problem. Thanks. That's really helpful. Amazon's just mailed to say the Core Animation book should be with me in a few days. From what I've seen and tried so far this layered and

Re: resizing window containing NSView with CALayer

2011-08-08 Thread Ken Ferry
On Mon, Aug 8, 2011 at 5:23 AM, Graham Cox graham@bigpond.com wrote: On 08/08/2011, at 9:35 PM, julius wrote: When I go and drag the resize handle to make the window as small as I can make it, i.e. so the window's content rect has zero height then the view misbehaves, i.e. the top of

Re: resizing window containing NSView with CALayer

2011-08-08 Thread Kyle Sluder
On Mon, Aug 8, 2011 at 4:37 PM, Ken Ferry kenfe...@gmail.com wrote: See also Cocoa Auto Layout, which addresses this issue among others.  (Have people caught this? I'm a little surprised there hasn't been more chatter.  We're replacing the autoresizing mask entirely.) I would imagine it will

Re: resizing window containing NSView with CALayer

2011-08-07 Thread julius
On 7 Aug 2011, at 02:31, Graham Cox wrote: I think you need to set the resizing mask for the layer as well - since you're creating this yourself, it's your responsibility: zCALayerRoot.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable; If you want the layer to redraw its

Re: resizing window containing NSView with CALayer

2011-08-07 Thread Kyle Sluder
On Sun, Aug 7, 2011 at 1:05 PM, julius jul...@juliuspaintings.co.uk wrote: It is not a problem with the layers. I get exactly the same behaviour if I leave out all the layer stuff and instead code the following in the view Meaning, you still call -setLayer: and -setWantsLayer:, but don't do

Re: resizing window containing NSView with CALayer

2011-08-07 Thread Graham Cox
On 08/08/2011, at 5:52 AM, julius wrote: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { I didn't notice first time through that this is where your code resides (sometimes the most obvious errors pass by when you're looking out for a more subtle error). It's

resizing window containing NSView with CALayer

2011-08-06 Thread julius
Hi, is this a system error or I'm doing something wrong? In IB place a custom NSView onto a NSWindow and make sure there is a good sized border between the view and the edges of the window. In the size pane of the inspector set all the struts and springs so the view will resize with the

Re: resizing window containing NSView with CALayer

2011-08-06 Thread Graham Cox
I think you need to set the resizing mask for the layer as well - since you're creating this yourself, it's your responsibility: zCALayerRoot.autoresizingMask = kCALayerWidthSizable | kCALayerHeightSizable; If you want the layer to redraw its content when it resizes, you also have to set: