On Mar 10, 2008, at 3:52 PM, Jonathan Dann wrote:

Hi Guys,

I have a couple of views in my app that get re-scaled by changing their frames. When I turn on layer backing for the view, the animation of the views' contents (a couple of NSColorWells & NSButtons) is choppy and renders badly, but when I omit the layer- backing activation the animation still works (why?).

layer back animation is only required for certain types of Animatable Container animations.resizing isn't one.

fi you stop the animation of the replaceSubview... is that no longer choppy? This is one of the most expensive animations possible.

also, are all your boundaries integral?


Can anybody tell me what's going on? Ideally I don't want to have the views hidden between transitions.

Here's the offending code:

- (IBAction)selectPreferencePanel:(id)sender;
{
        NSView *newView = [self viewForTag:[sender tag]];
        NSView *oldView = [[self.window.contentView subviews] firstObject];
        self.window.title = [self windowTitleForTag:[sender tag]];
        NSRect frame = [self frameForContentView:newView];
        [NSAnimationContext beginGrouping];
        [[self.window animator] setFrame:frame display:YES];
[[self.window.contentView animator] replaceSubview:oldView with:newView];
        [NSAnimationContext endGrouping];
}

and [[[self window] contentView] setWantsLayer:YES]; is set in - awakeFromNib.

it's in a NSWindowController that aims to have a window that swaps subviews of the window's contentView in and out when different toolbar items are selected. The frameForContentView method just grabs looks at the size the window needs to be for the new content, resizes are only vertical as horizontal and vertical resize at the same time look bad to me!

Thanks a lot,

Jon_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/scott%40cocoadoc.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to