• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: fixed width of a pane in NSSplitView (solved)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >fixed width of a pane in NSSplitView (From: Vladimir Sokolov <email@hidden>)
 >Re: fixed width of a pane in NSSplitView (From: Milen Dzhumerov <email@hidden>)

  • Prev by Date: Fwd: Use of a int type property
  • Next by Date: Re: Core Data & IB in prefs pane ("Cannot perform operation without a managed object context")
  • Previous by thread: Re: fixed width of a pane in NSSplitView
  • Next by thread: App Crashing when remove an Object
  • Index(es):
    • Date
    • Thread