Re: Trouble with NSSplitView
Re: Trouble with NSSplitView
- Subject: Re: Trouble with NSSplitView
- From: Andre Masse <email@hidden>
- Date: Tue, 07 Oct 2008 22:59:01 -0400
Thanks a lot for the explanation Jon. This makes it clear now. Thanks
also to Dave. It was good to know I wasn't the only one struggling
with this.
Andre Masse
On Oct 7, 2008, at 22:43, Jonathan Hess wrote:
On Oct 7, 2008, at 4:44 PM, Dave Fernandes wrote:
I had the same problem. The fix was to recreate the view in IB.
Seems to be a bug in IB, but I never tried to repeat the problem
once it was fixed.
This isn't a problem with IB, it also isn't unique to split views.
The problem has to do with how the autoresizing rules used by NSView
are applied. They're applied as scaled deltas from previous values,
and when you fully collapse a split view, you have a view size that
goes to zero, and all of the scaling then clamps to zero (zero times
anything is zero).
To deal with this, this you should use the NSSplitView delegate
methods to prevent the view from getting smaller than some minimum
size. The typical behavior is to have the split view resizing
towards the minimum, when it gets to that minimum it stops resizing
even as the user continues to drag the mouse. Once the user drags
the mouse all of the way, the view completely collapses. Behind the
scenes, NSSplitView doesn't make the subview any smaller than the
minimum size, but that isn't evident to the user.
You can see this behavior in Mail. Open a Mail window, and then drag
the split bar that splits the messages table and the message
composition view. When the split bar gets to about 100 points from
the bottom of the window it stops moving. If you keep dragging, the
splitter eventual jumps the remaining distance.
Jon Hess
_______________________________________________
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