Re: fixed width of a pane in NSSplitView (solved)
Re: fixed width of a pane in NSSplitView (solved)
- Subject: Re: fixed width of a pane in NSSplitView (solved)
- From: Vladimir Sokolov <email@hidden>
- Date: Fri, 28 Mar 2008 23:58:30 +0100
28.03.2008, в 23:40, Milen Dzhumerov написал(а):Hi Milen,
Great! It works. Thanks a lot!
Regards,
Vladimir
On 28 Mar 2008, at 22:34, Vladimir Sokolov wrote:
Hi All.
How can I make fixed width of the left pane in the NSSplitView?
I want to make it as in iTunes. When user resize a window only
right pane should change width.
Hi Vladimir,
Your split view delegate should implement the following method:
-(void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:
(NSSize)oldSize
{
CGFloat dividerThickness = [sender dividerThickness];
NSRect leftRect = [[[sender subviews] objectAtIndex:0] frame];
NSRect rightRect = [[[sender subviews] objectAtIndex:1] frame];
NSRect newFrame = [sender frame];
leftRect.size.height = newFrame.size.height;
leftRect.origin = NSMakePoint(0, 0);
rightRect.size.width = newFrame.size.width - leftRect.size.width
- dividerThickness;
rightRect.size.height = newFrame.size.height;
rightRect.origin.x = leftRect.size.width + dividerThickness;
[[[sender subviews] objectAtIndex:0] setFrame:leftRect];
[[[sender subviews] objectAtIndex:1] setFrame:rightRect];
}
Regards,
Milen
Thanks!
- Vladimir
_______________________________________________
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
_______________________________________________
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