Re: Animated split view collapsing
Re: Animated split view collapsing
- Subject: Re: Animated split view collapsing
- From: "Lawrence Sanbourne" <email@hidden>
- Date: Fri, 5 May 2006 11:18:17 -0500
On 5/4/06, Paul Kim <email@hidden> wrote:
On May 4, 2006, at 11:40 AM, Lawrence Sanbourne wrote:
>
> Thank you so much! That was tremendously helpful. I cleaned up my code
> based on yours, and the animation is working. It's fairly jerky, but I
> think I might have to be satisfied now. My code is below, if anyone
> wants to use it or try to explain the jerkiness.
>
My guess is the jerkiness is because you are calling setNeedsDisplay
instead of display. In the comment in your code, you mention that
calling display causes an infinite loop. I don't have that problem
with mine so I suspect that maybe one of your draw methods
(drawDividerInRect?) might be altering the splitview in some way? If
that is the case, I'd restructure your code as it's a bad idea to
have drawing code change any state in the object. Maybe if you could
provide a stack of the loop, we could better ascertain what is
happening.
1. Here's the stack trace starting from near the bottom:
================================================================
#23862 0x000b58d8 in -[LS
MainWindowController splitView:resizeSubviewsWithOldSize:] at LS
MainWindowController.m:359
#23863 0x9382be4c in -[NSSplitView resizeSubviewsWithOldSize:]
#23864 0x93835f78 in -[NSSplitView _regionForOpaqueDescendants:forMove:]
#23865 0x93766584 in -[NSView _regionForOpaqueDescendants:forMove:]
#23866 0x93835fa4 in -[NSSplitView _regionForOpaqueDescendants:forMove:]
#23867 0x93766584 in -[NSView _regionForOpaqueDescendants:forMove:]
#23868 0x93766584 in -[NSView _regionForOpaqueDescendants:forMove:]
#23869 0x93785ac4 in -[NSThemeFrame _regionForOpaqueDescendants:forMove:]
#23870 0x93765770 in -[NSView _drawRect:clip:]
#23871 0x93764c1c in -[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#23872 0x93785664 in -[NSThemeFrame
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#23873 0x9375e674 in -[NSView
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
#23874 0x93753968 in -[NSView displayIfNeeded]
#23875 0x000b58d8 in -[LSMainWindowController
splitView:resizeSubviewsWithOldSize:] at LSMainWindowController.m:359
#23876 0x9382be4c in -[NSSplitView resizeSubviewsWithOldSize:]
#23877 0x93835f78 in -[NSSplitView _regionForOpaqueDescendants:forMove:]
#23878 0x93766584 in -[NSView _regionForOpaqueDescendants:forMove:]
#23879 0x93835fa4 in -[NSSplitView _regionForOpaqueDescendants:forMove:]
#23880 0x93766584 in -[NSView _regionForOpaqueDescendants:forMove:]
#23881 0x93766584 in -[NSView _regionForOpaqueDescendants:forMove:]
#23882 0x93785ac4 in -[NSThemeFrame _regionForOpaqueDescendants:forMove:]
#23883 0x93765770 in -[NSView _drawRect:clip:]
#23884 0x93764c1c in -[NSView
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#23885 0x93785664 in -[NSThemeFrame
_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
#23886 0x9375e674 in -[NSView
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
#23887 0x93753968 in -[NSView displayIfNeeded]
#23888 0x937d9678 in UpdateViewAnimationViews
#23889 0x907dc82c in CFDictionaryApplyFunction
#23890 0x937d92d0 in -[NSViewAnimation setCurrentProgress:]
#23891 0x937d920c in -[NSAnimation(NSInternal) _advanceTime]
#23892 0x92978f5c in __NSFireTimer
#23893 0x907f7aec in __CFRunLoopDoTimer
#23894 0x907e4464 in __CFRunLoopRun
#23895 0x907e3a18 in CFRunLoopRunSpecific
#23896 0x92985164 in -[NSRunLoop runMode:beforeDate:]
#23897 0x000f4844 in -[MySplitView setSplitterPosition:animate:] at
MySplitView.m:131
#23898 0x000b5364 in -[LSMainWindowController toggleInfoView:] at
LSMainWindowController.m:307
================================================================
Beyond this, it starts repeating (repeats #23862-#23874).
2. LSMainWindowController.m:359 is the [sender display] call:
- (void)splitView:(MySplitView *)sender
resizeSubviewsWithOldSize:(NSSize)oldSize {
// Don't interfere with animation.
if ([sender isSplitterAnimating]) {
[sender display]; // LSMainWindowController.m:359
return;
}
// ...
}
3. I used some NSLogs to verify that -isSplitterAnimating is returning
the correct value.
4. I'm not overriding any of the NSSplitView draw methods.
5. The app exits with status -1 and then starts loading ~23,000 stack
frames. My initial Googling didn't tell me whether status -1 is a
stack overflow or something more useful.
I stared at the stack trace and and my code, and I don't see what's
causing the -splitView:resizeSubviewsWithOldSize: delegate method to
get called repeatedly. Any suggestions anyone can offer would be
great.
Larry
_______________________________________________
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