Re: Challenge: Block Main Thread while Work is done, with Timeout
Re: Challenge: Block Main Thread while Work is done, with Timeout
- Subject: Re: Challenge: Block Main Thread while Work is done, with Timeout
- From: Uli Kusterer <email@hidden>
- Date: Sat, 25 Jul 2009 13:12:19 +0200
Am 25.07.2009 um 03:27 schrieb Graham Cox:
Display a modal progress window which tells the user's what's going
on, show an indeterminate progress bar and include a "Stop" button.
The worker code can wait on the alias being resolved and the main
thread can keep the user informed. By using a modal progress window
you've effectively "blocked" the user from doing anything but if
they are not prepared to wait they have a way to abort the operation
(which you have to implement of course). Just blocking without
telling the user what's going on is worse than just beachballing -
the beachball is after all a feedback mechanism that tells the user
*something*.
Even better: DON'T use a modal progress panel. The Finder has done the
exact same thing correctly, by using a modeless progress panel (I have
code for that on my web site, I think, UKProgressPanel or something
like that). Start that action, show progress in a progress panel (and
maybe start a spinner somewhere), let the rest of the app keep
running, except for maybe disabling UI elements that are blocked until
that other action has finished.
This is OS X folks, we should try avoiding modality wherever possible.
If your user can do other things in your app while such a process
takes a while, LET THEM.
That said, make sure the user knows that you're busy and that you
heard their request. E.g. if you're taking longer, detect that and
bring the (modeless) progress panel to the front after 4 seconds or
so. It would be kinda silly if an action that is usually immediate but
occasionally takes a minute to time out always showed a modal progress
panel for a split-second. Users would get epileptic seizures from the
title bar flashing ;-)
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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