• 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
Re: CoreAnimation in a modal window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreAnimation in a modal window


  • Subject: Re: CoreAnimation in a modal window
  • From: Pierre Bernard <email@hidden>
  • Date: Fri, 11 Apr 2008 14:47:23 +0200

Hi!

It appears that I need to "push" the NSRunLoop in default mode rather than modal for NSAnimationContext to work:

		[[NSRunLoop currentRunLoop] acceptInputForMode:NSDefaultRunLoopMode
											beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];


Pierre

On 10 Apr 2008, at 17:33, 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



_______________________________________________

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

--- Pierre Bernard http://www.bernard-web.com/pierre http://www.houdah.com



Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >CoreAnimation in a modal window (From: Pierre Bernard <email@hidden>)

  • Prev by Date: Re: custom dragging destination feedback in an NSTableView
  • Next by Date: Multiple NSViews
  • Previous by thread: Re: CoreAnimation in a modal window
  • Next by thread: recursive dir searching
  • Index(es):
    • Date
    • Thread