• 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 similar to Xcode's editor/debug area split view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSplitView similar to Xcode's editor/debug area split view


  • Subject: Re: NSSplitView similar to Xcode's editor/debug area split view
  • From: Andy Lee <email@hidden>
  • Date: Fri, 28 Jun 2013 07:58:31 -0400

Hi Chuck,

On Jun 26, 2013, at 8:30 PM, Chuck Soper <email@hidden> wrote:
> 2. How should I animate the showing or hiding of the 'debug area' view?

I do by sending setFrame: to the two subviews' animator proxies instead of to the view itself.

// Assumes the split view has two subviews, one above the other.
- (void)_setTopSubviewHeight:(CGFloat)newHeight
         forTwoPaneSplitView:(NSSplitView *)splitView
                     animate:(BOOL)shouldAnimate
{
    NSView *viewOne = [[splitView subviews] objectAtIndex:0];
    NSRect frameOne = [viewOne frame];
    NSView *viewTwo = [[splitView subviews] objectAtIndex:1];
    NSRect frameTwo = [viewTwo frame];

    frameOne.size.height = newHeight;
    frameTwo.size.height = ([splitView bounds].size.height
                            - [splitView dividerThickness]
                            - newHeight);
    if (shouldAnimate)
    {
        [NSAnimationContext beginGrouping];
        [[NSAnimationContext currentContext] setDuration:0.1];
        {{
            [[viewOne animator] setFrame:frameOne];
            [[viewTwo animator] setFrame:frameTwo];
        }}
        [NSAnimationContext endGrouping];
    }
    else
    {
        [viewOne setFrame:frameOne];
        [viewTwo setFrame:frameTwo];
    }
}

There may be a better way, but this seems to work.

--Andy


_______________________________________________

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: 
 >NSSplitView similar to Xcode's editor/debug area split view (From: Chuck Soper <email@hidden>)

  • Prev by Date: Re: IB Objects Overlap once compiled
  • Next by Date: Re: Cocoa-dev Digest, Vol 10, Issue 397
  • Previous by thread: NSSplitView similar to Xcode's editor/debug area split view
  • Next by thread: KVO on a key path with nil intermediate properties
  • Index(es):
    • Date
    • Thread