Re: Progress Bar while Reading a File
Re: Progress Bar while Reading a File
- Subject: Re: Progress Bar while Reading a File
- From: Ondra Cada <email@hidden>
- Date: Thu, 27 Apr 2006 20:59:35 +0200
John,
On 27.4.2006, at 20:42, John Nairn wrote:
I am trying to find the best way to display a progress bar while
reading a file which might take a long time.
Have you considered this? http://fishbowl.pastiche.org/2003/08/01/
the_placebo_minipattern :)
current guess is to detach thread to read the file and put progress
bar in modal window. My goal was to have a timer in the modal run
loop to periodically check and display the progress. The file
thread works fine, but the timer never fires in the modal loop.
Below is code fragment. I thought I had to start a modal session
and then add the timer within that modal loop. The "timer started"
message appears, but the time never fires.
It cannot. Timer is an event thing -- it fires (more or less) by
entering a new event into the event loop when there's nothing other
to do and when the time is right.
The timer-based solution would have to start the modal session *and
then return from the method*, leaving the loading thread to load and
the main thread to happily fire. When loading is finished, another
method would quit the modal session, hide the progress, etc.
Note: it is questionable whether you really want the modal session.
Depends on the actual design, but *generally* it would be better to
let the user to freely exploit all the functionalities which are not
directly hindered by loading (say, setting preferences, opening help,
whatever...).
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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