Re: Live previewing of a loop's progress
Re: Live previewing of a loop's progress
- Subject: Re: Live previewing of a loop's progress
- From: publiclook <email@hidden>
- Date: Mon, 17 Feb 2003 09:38:59 -0500
If you use a tight loop you need to call -display and possibly
-flushWindow.
A better approach is to modify your loop so that events can still be
processed. That way you can have a cancel button that works and the
applications menus will work etc. programmed in mail:
- (void)renderStep:(id)dummy
{
// do some rendering
[someImageView setImage:imageComposited];
// if finished rendering set done = YES
if(!done) {
[self preformSelector:@selector(renderStep:) withObject:nil
afterDelay:0];
}
}
- (void)start:(id)sender
{
done = NO;
[self preformSelector:@selector(renderStep:) withObject:nil
afterDelay:0];
}
- (void)stop:(id)sender
{
done = YES;
}
On Monday, February 17, 2003, at 03:11 AM, Brian Ganninger wrote:
Part of my app's interface is an NSImageView that I use as a preview of
what's going on while the program works. What happens is that a
progress
indicator starts before the beginning of the loop, then the loop
executes
and during the loop a method is called that composites an NSImage,
which is
then passed over to the NSImageView via [NSImageView
setImage:imageComposited]; so the user can see the compositing
results. The
loop then continues on.
What actually happens though is that the loop executes entirely
without the
ImageView updating until the loop has finished. I know the image is
compositing correctly because during the loop the image is written out
as a
.icns file, which I've opened and checked, and they are correct. The
problem
lies in how can I force this to update or introduce a stutter of some
sort
to make the ImageView update?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.