Code for NSMovieView updating in a loop problem
Code for NSMovieView updating in a loop problem
- Subject: Code for NSMovieView updating in a loop problem
- From: "Theodore H. Smith" <email@hidden>
- Date: Tue, 26 Jul 2005 12:05:34 +0100
void CSplashWnd::Update() {
if ( [myMovieView lockFocusIfCanDraw ] ) {
NSRect R = [myMovieView frame];
[myMovieView drawRect : R ];
[myMovieView unlockFocus];
}
[myMovieView display];
NSDate* d = [NSDate dateWithTimeIntervalSinceNow:0.05];
[NSApp runUntilDate:d];
static int CallNum = 0;
CallNum++;
if (CallNum > 50) {
CallNum = 0;
}
NSString* s = CreateMovingNSString(CallNum); // looks like " X"
[myTextView setString : s];
[myTextView display];
}
I see myTextView having an "X" sliding around inside of it, but the
movieview is not displayed. I have properly initialised the movie,
because as soon as the method ends, the movie is displayed with no
intervention from me.
I'm testing this method like this:
clock_t tFirst = clock();
while ( ( clock() - tFirst ) < 500 ) {
Splash.Update();
}
It's just a test method, to see if I can get this to work.
Any ideas anyone? I'm trying to get the movie to update in a loop.
I'm calling runUntilDate, also. Maybe I'm not calling it correctly?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden