• 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
Sliding Split Views, part II
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sliding Split Views, part II


  • Subject: Sliding Split Views, part II
  • From: Sam Krishna <email@hidden>
  • Date: Fri, 23 Jan 2009 12:04:13 -0500

I'm using the following code to create an animated sliding SplitView using an NSButton to toggle whether the split view is *up* and you can see the lower split view, or *down* and the lower split view is hidden. Here's the code:

- (IBAction)toggleVariables:(id)sender
{
    NSSize newSize = [detailSplit frame].size;

    [NSAnimationContext beginGrouping];
    [[NSAnimationContext currentContext] setDuration:.25];

    if ([sender state] == NSOnState)
    {
        newSize.height = 4 * (newSize.height / 5);
	[[theUpperSubView animator] setFrameSize:newSize];
        newSize.height = (newSize.height / 5);
	[[theLowerSubView animator] setFrameSize:newSize];
    }
    else if ([sender state] == NSOffState)
    {
	[[theUpperSubView animator] setFrameSize:newSize];
	newSize.height = 0;
	[[theLowerSubView animator] setFrameSize:newSize];
    }

    [NSAnimationContext endGrouping];
}

Currently, the above code animated the sliding split view as if it's opening, but it essentially *pushes* the top edge of theUpperSubView above the superview's top edge in the window.

I'd like to replicate the result that you see in Automator where, on the left-hand side of the main split view, when you click on the "Description View" button, the library view is essentially placed below/behind the DescriptionView. when it slides up as it's opening. To see this, open Automator, select any random Automator Action, and click the "View Description" button on the lower left-hand side of the document window.

TIA!

Live Playfully,

Sam
-----
If he listens in faith,
finding no fault, a man is free
and will attain the cherished words
of those who act in virtue.

_______________________________________________

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


  • Prev by Date: Re: Encryption: Simplest method to encrypt a SQLite DB file...?
  • Next by Date: sqlite iphone question....
  • Previous by thread: Re: Encryption: Simplest method to encrypt a SQLite DB file...?
  • Next by thread: Re: Sliding Split Views, part II
  • Index(es):
    • Date
    • Thread