ScreenSaverView subclass won't animate in preview or test
ScreenSaverView subclass won't animate in preview or test
- Subject: ScreenSaverView subclass won't animate in preview or test
- From: Christopher Hickman <email@hidden>
- Date: Thu, 01 Mar 2007 10:32:06 -0800
Greetings,
I have written a ScreenSaverView subclass that loads a Quartz Composer file into a child QCView. It works fine as a screensaver, but it just shows a blank black screen when run as a preview or if the "Test" button is clicked.
According to my logs, it does -initWithFrame:isPreview: either way, but it only calls -drawRect: and -animateOneFrame: if it is run for real.
The docs don't seem to indicate that I'd have to do anything special to make it work in preview, and I can't find anything about "Test" mode.
Thanks for any hints.
Topher
Here's my -initWithFrame:isPreview: method:
- (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
{
//Sorry, Mr. Shipley
self = [super initWithFrame:frame isPreview:isPreview];
NSLog(@"QCScreenSaverView initalizing...");
if (self) {
NSBundle *saverBundle = [NSBundle bundleForClass:[self class]];
[self setAnimationTimeInterval:1/30.0];
[self setComposerView: [[QCView alloc] initWithFrame:frame]];
//The name of the Quartz Composer file to be used as the screensaver
//is stored in the Info.plist key QCSQuartzComposerFile
NSString *qtzPath = [NSString stringWithString:[saverBundle pathForResource:[[saverBundle infoDictionary] objectForKey:@"QCSQuartzComposerFile"] ofType:@"qtz"]];
if([[self composerView] loadCompositionFromFile:qtzPath]) {
NSLog([@"Composition loaded from path: " stringByAppendingString:qtzPath]);
} else {
NSLog([@"Composition failed to load from path: " stringByAppendingString:qtzPath]);
return nil;
}
}
return self;
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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