Re: NSSplitView IB and auto resize problems
Re: NSSplitView IB and auto resize problems
- Subject: Re: NSSplitView IB and auto resize problems
- From: Bertil Holmberg <email@hidden>
- Date: Mon, 28 Jan 2008 11:37:32 +0100
I believe you have to use some of the NSSplitView delegate methods.
Here are some examples but they are five years old so use them with
care ;-)
I recall fighting a good deal with this before getting anywhere...
I'm sure you can find more of the same kind online, good luck!
Regards,
Bertil
// Delegate methods from NSSplitView
- (BOOL)splitView:(NSSplitView *)sender canCollapseSubview:(NSView *)
subview
{
if ( subview == travContainer ) {
return YES; // this view can collapse
}
return NO; // the other view cannot collapse
}
// Allows top view to shrink to half the height of the split view
- (float)splitView:(NSSplitView *)sender constrainMinCoordinate:
(float)proposedMin ofSubviewAt:(int)offset
{
// proposedMin is 0.0
return (float)(rint([sender bounds].size.height / 2));
}
// Allows the bottom view to shrink to 75 pixels, after which it
collapses
- (float)splitView:(NSSplitView *)sender constrainMaxCoordinate:
(float)proposedMax ofSubviewAt:(int)offset
{
// proposedMax is 425
return ([sender bounds].size.height - 75);
}
// Allows only incremental changes of the split position
- (float)splitView:(NSSplitView *)sender constrainSplitPosition:
(float)proposedPosition ofSubviewAt:(int)offset
{
int pP = (int)proposedPosition;
return (float)(pP - ( pP % 18)); // % operator only handles int
}
_______________________________________________
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