• 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: NSSplitView resizing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSplitView resizing


  • Subject: Re: NSSplitView resizing
  • From: Oftenwrong Soong <email@hidden>
  • Date: Wed, 26 Aug 2009 20:55:30 -0700 (PDT)

On Wednesday, August 26, 2009 8:22:24 PM, Brandon Walkin <email@hidden> wrote:
> This can be done completely in IB if you use BWToolkit. http://brandonwalkin.com/bwtoolkit/
>
> Demo video: http://brandonwalkin.com/blog/videos/iCalSplitView.mov
>
> Brandon


Wow, that is a *really* impressive control! Thanks for the video and for pointing out your toolkit. I'll be checking it out.

In this app my needs are very limited (for now at least!) so I implemented a simple delegate method. Everyone's input helped tremendously. Thanks to everyone who posted:

- (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize
{
NSRect newFrame = [sender frame];
NSArray * subviews = [sender subviews];
CGFloat dividerThickness = [sender dividerThickness];

NSView * leftView = [subviews objectAtIndex:0];
NSRect leftFrame = [leftView frame];

NSView * rightView = [subviews objectAtIndex:1];
NSRect rightFrame = [rightView frame];

// Height always follows split view
leftFrame.size.height = rightFrame.size.height = newFrame.size.height;

// Width of left frame is left untouched; All width resizing occurs in right frame
rightFrame.size.width = newFrame.size.width - leftFrame.size.width - dividerThickness;

// Post our changes
[leftView setFrame:leftFrame];
[rightView setFrame:rightFrame];
}




_______________________________________________

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

  • Follow-Ups:
    • Re: NSSplitView resizing
      • From: Bill Cheeseman <email@hidden>
References: 
 >NSSplitView resizing (From: Oftenwrong Soong <email@hidden>)
 >Re: NSSplitView resizing (From: Brandon Walkin <email@hidden>)

  • Prev by Date: Re: Problem building for 10.4 on 10.6
  • Next by Date: Re: Problem building for 10.4 on 10.6
  • Previous by thread: Re: NSSplitView resizing
  • Next by thread: Re: NSSplitView resizing
  • Index(es):
    • Date
    • Thread