Re: CoreAnimation in a modal window
Re: CoreAnimation in a modal window
- Subject: Re: CoreAnimation in a modal window
- From: Dimitri Bouniol <email@hidden>
- Date: Thu, 10 Apr 2008 10:26:10 -0700
That error indicates that the image stored for the layer is too large
(because the layer itself is too large probably) for your graphics
card to handle, and therefore won't be drawn. Consider using smaller
layers, or take a look at CATiledLayer. Never tried it, but that's
what NSScrollView uses when layer backing is requested, as to handle
the large scrolling view as many smaller layers tiled to make it look
as if it was all one large layer.
On Apr 10, 2008, at 8:33 AM, Pierre Bernard wrote:
Hi!
I am trying to do some nice drawing using CoreAnimation. It all
works fine, except for a long series of "CoreAnimation: rendering
error 500" messages.
However, as soon as I try to use my window in the context of a modal
session, only the background is draw. The actual animated layers are
missing.
What am I doing wrong?
- (NSUInteger)beginModalWindow:(NSWindow *)modalWindow
{
NSModalSession currentModalWindowSession;
if ([[modalWindow delegate]
respondsToSelector:@selector(windowWillBeginModal:)]) {
[[modalWindow delegate] windowWillBeginModal:modalWindow];
}
[modalWindow makeKeyAndOrderFront:self];
if ([[modalWindow delegate]
respondsToSelector:@selector(windowDidBeginModal:)]) {
[[modalWindow delegate] windowDidBeginModal:modalWindow];
}
currentModalWindowSession = [NSApp
beginModalSessionForWindow:modalWindow];
NSUInteger result = NSOKButton;
while(1) {
NSInteger response = [NSApp
runModalSession:currentModalWindowSession];
if (response == NSRunAbortedResponse) {
result = NSCancelButton;
}
if (response != NSRunContinuesResponse) {
break;
}
}
[NSApp endModalSession:currentModalWindowSession];
if ([[modalWindow delegate]
respondsToSelector:@selector(windowWillEndModal:)]) {
[[modalWindow delegate] windowWillEndModal:modalWindow];
}
[modalWindow orderOut:self];
if ([[modalWindow delegate]
respondsToSelector:@selector(windowDidEndModal:)]) {
[[modalWindow delegate] windowDidEndModal:modalWindow];
}
return result;
}
Best,
Pierre Bernard
---
Pierre Bernard
http://www.bernard-web.com/pierre
http://www.houdah.com
--
定魅刀利
Dimitri Bouniol
email@hidden
http://web.mac.com/dimitri008/
_______________________________________________
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