All works!

Used workarounds:

1. [super setAutostartsRendering:YES] will heal the static composition to show 
animation.
2. Use -hitTest: instead of -mouseUp: will heal mouse pressing on 10.4 (a known 
issue by mail-lists some years ago for Tiger)
3. And the hardcode the path instead of -pathForResource:ofType: will load the 
composition.

Thanx for all, but I think, Apple may rename "Inconsistent state" to "File not 
found" ))


The working code for 10.4:


@implementation MyCompositionView // inherited from QCView

-( id )initWithFrame:( NSRect )rect
{
if (self = [super initWithFrame:rect])
{
[super setAutostartsRendering:YES];
[super setEraseColor:[NSColor colorWithCalibratedRed:0 green:0 blue:0 
alpha:0]]; // see comment "Re:" below
NSString* composition = [[NSBundle bundleForClass:[self class]] 
pathForResource:@"composition" ofType:@"qtz"];
NSLog( @">>>>>>> %@", composition ); // show (null)
[super loadCompositionFromFile:@"/temp/composition.qtz"]; // load success
// composition is on both places: inside the /temp folder and in Resources of 
bundle.
return self;
}
return nil;
}

-( void )doSomeActionByMouseClicks
{
id object = [super window];

if ([object respondsToSelector:@selector( doSomeActionByMouseClicks )])
{
MyAboutWindow* parentWindow =( MyAboutWindow* )object;
[parentWindow doSomeActionByMouseClicks];
}
}

// Mac OS Tiger has bug with no mouseDown and mouseUp events received to 
subclassed QCView.
#if (MAC_OS_VERSION_MAX_ALLOWED > MAC_OS_VERSION_10_4)

-( void )mouseUp:( NSEvent* )theEvent
{
[self doSomeActionByMouseClicks];
[super mouseUp:theEvent];
}

#else

-( NSView* )hitTest:( NSPoint )thePoint
{
[self doSomeActionByMouseClicks];
return [super hitTest:thePoint];
}

#endif

// Re: set the transparent color in three placed: to window background, to the 
eraseColor and inside the composition as Billboard to make the composition 
background transparent.

@end

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to