On Mar 20, 2012, at 7:00 PM, Peter Ammon wrote: > 2. Establish another constraint that says the height of the document view > equals the height of the scroll view. Give this constraint a priority lower > than required. What its priority should be depends on how tightly you want > the document view to fill the scroll view, i.e. which other constraints it > should be allowed to break.
This sounds great in concept, but the height I want (if the constraints will allow it) is the scroll view’s documentVisibleRect, not its frame, since the latter includes the size of the scroll bars if they’re visible, and I don’t think that’s doable directly via constraints. However, watching the scroll view’s NSViewFrameDidChangeNotification and manually adding non-required constraints to the size I get from -documentVisibleRect (and clearing out those constraints the next time) works like a champ. As you point out, the mistake I was making before was calling setFrame: here instead of doing this via constraints. Thanks! Charles _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com