Re: Prevent side subviews of NSSplitView from resizing during window zoom
Re: Prevent side subviews of NSSplitView from resizing during window zoom
- Subject: Re: Prevent side subviews of NSSplitView from resizing during window zoom
- From: Antonio Nunes <email@hidden>
- Date: Sat, 29 Oct 2011 04:05:29 +0200
On 26 Oct 2011, at 17:46, Antonio Nunes wrote:
> I use an NSSPlitView with three subviews. The general idea is that when the window is resized, only the middle view resizes. I have this working just fine when dragging the window frame. The split view consults the delegate with splitView:shouldAdjustSizeOfSubview:, and I return YES when the subview is the middle view, and NO when the subview is one of the other views. (It's slightly more complex, due to minimum widths, but that can be ignored here.) When I drag the window frame, the splitView:shouldAdjustSizeOfSubview: is constantly consulted for each view, for the duration of the drag.
>
>
> When zooming the window by clicking the zoom button though, all subviews are resized. The splitView:shouldAdjustSizeOfSubview: method is consulted only twice during the zoom and the split view goes off and does its own thing anyway.
> How can I make the split view behave correctly during window zoom (and entering/exiting full-screen, which shows the same issue)?
Figured it out:
The split view was correctly honoring splitView:shouldAdjustSizeOfSubview:'s return value, but the logic within the method wasn't always yielding the correct results, due to unexpected behavior elsewhere. I am keeping a tab on how the window is being resized to decide what subviews can be resized. The window's delegate methods are not always called though at the time you'd expect, and not symmetrically. Particularly, I found that windowDidResize: can be called well before the zoom has finished, and that it is called once more often than windowWillResize:toSize:. Once I became aware of that, I was able to solve the issue.
-António
-----------------------------------------------------------
What you have inside you expresses itself through both your
choice of words and the level of energy you assign to them.
The more healed, whole and connected you feel inside,
the more healing your words will be.
--Rita Goswami
-----------------------------------------------------------
_______________________________________________
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