Re: Animated split view collapsing
Re: Animated split view collapsing
- Subject: Re: Animated split view collapsing
- From: "Lawrence Sanbourne" <email@hidden>
- Date: Sun, 23 Apr 2006 17:10:34 -0500
Thanks for the help. Here's what I get when the code runs:
*** NSTimer discarding exception '*** -[NSCFArray objectAtIndex:]:
index (1) beyond bounds (0)' that raised during firing of timer with
target 3b9990 and selector '_advanceTime'
_advanceTime is called by NSViewAnimation code.
That error is repeated over and over, seemingly forever. I tried
switching it to NSAnimationNonblocking, and this fixed the hang but
caused weird drawing behavior. (No animation, just elements inside the
split view jumping to weird positions.)
Here's the modified code I'm using:
- (IBAction)animateSplitView:(id)sender
{
static float s_delta = DELTA;
/* Parameters (to be refactored) */
NSView *targetView = widgetInfoViewBezel;
NSView *splitView = sourceInfoSplitView;
/* End parameters */
NSRect frame = [targetView frame];
frame.origin.y += s_delta;
frame.size.height -= s_delta;
NSDictionary *windowResize;
windowResize = [NSDictionary dictionaryWithObjectsAndKeys:
targetView, NSViewAnimationTargetKey,
[NSValue valueWithRect: frame],
NSViewAnimationEndFrameKey,
nil];
NSViewAnimation *animation = [[NSViewAnimation alloc]
initWithViewAnimations:[NSArray arrayWithObject:windowResize]];
[animation setAnimationBlockingMode:NSAnimationBlocking];
[animation setDuration:0.5];
[animation startAnimation];
[animation release];
s_delta *= -1;
s_delta += 1;
[splitView display];
}
Any ideas?
Regarding the split view divider thickness, I actually want it to
disappear only when the split pane is collapsed. Try clicking the info
button in iCal to see what I mean.
Larry
On 4/23/06, I. Savant <email@hidden> wrote:
>
> Regarding the CocoaDev code you referenced, can you post the
> specific error(s) you are receiving? Have you used the debugger to
> determine why the code loops?
>
> Regarding making the splitter bar disappear, check the NSSplitView
> documentation and look at the -dividerThickness method. You can
> subclass and override this to make the divider any size you want,
> including, I believe, zero.
>
> --
> I.S.
>
>
> On Apr 23, 2006, at 3:22 PM, Lawrence Sanbourne wrote:
>
> > Hello,
> >
> > Does anyone have any code for collapsing a pane of a split view, using
> > NSViewAnimation or other means? There's some CocoaDev code for this,
> > but it causes an infinite loop and lots of array bounds exceptions:
> >
> > http://www.cocoadev.com/index.pl?AnimatedNSSplitView
> >
> > I'd like the splitter bar to disappear entirely when the view is
> > collapsed. (This is the behavior in iCal and other Apple apps.)
> >
> > Larry
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Cocoa-dev mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> > 40gmail.com
> >
> > This email sent to email@hidden
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden