Re: Conceptual question
Re: Conceptual question
- Subject: Re: Conceptual question
- From: Mike Abdullah <email@hidden>
- Date: Tue, 24 Jan 2006 14:03:22 +0000
Hi Jeff, thanks very much for the reply. I think I ought to have
explained some things a little more clearly though.
This progress indicator is indeterminate, it just appears to let the
user know that a script is being run. Under normal circumstances it
should only appear for half a second, but sometimes it may take up to
5. What is was going to do was set the progress indicator to use
it's own thread - this way I don't have to write any code for a
separate thread, but the indicator will take care of it's own animation.
Can I ask, what exactly does this "deferred" option in the nib do? I
was wondering about whether to use the same nib or not since this
sheet will not necessarily be shown for every instance of the document.
Anyway, thanks very much for your help, if you or anyone else can
answer these follow-up questions I'd be very grateful,
Mike.
On 24 Jan 2006, at 13:09, Jeff LaMarche wrote:
On Jan 24, 2006, at 6:38 AM, Mike Abdullah wrote:
Where should I place the panels required for this? In my document
nib, or in their own nib?
What kind of controller set-up should I have to manage these
additional panels?
You'll probably want to just put the panels right in the same nib
as the window to which the sheet will be attached. If it's the
document window, then do it in the document nib. I don't see that
there would be much to gain by putting the panel in a separate
sheet, especially if you use the "deferred" option for the panel.
If you want to show a progress indicator, your long-running code is
going to have to take place in a thread, and you'll have to use DO
or performSelector:onMainThread:... to update the progress
indicator's value. It's not hard to do, but if you do it on the
main thread, the progress indicator will never get updated and the
user will see the spinning beach ball of death.
Basically, the same method where you show the sheet, you'll detach
the thread. When the thread is done, it can call a method on the
main thread that will tell the sheet to go away. You should
probably be able to glom together sample code from the threading
and sheet documentation and get it to work with a little effort..
Good luck.
Jeff
_______________________________________________
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