• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Conceptual question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conceptual question


  • Subject: Re: Conceptual question
  • From: Mike Abdullah <email@hidden>
  • Date: Sat, 28 Jan 2006 19:52:20 +0000

Hi Jeff,

I now have the whole thing up and running. Whilst I agree with you that in most cases one should send the task to another thread, I have found that my method works fine.

Basically, as the progress bar is needed for the first time, I call setUsesThreadedAnimation: to break the progress bar itself off into another thread. This causes the animation of it to be fine whilst my script is running.

The main reason I've gone with this technique is that the script is being run using NSAppleScript, which explicitly says I should use it only from the main thread. Is the something wrong with usesThreadedAnimation then?

Mike.

On 24 Jan 2006, at 14:22, Jeff LaMarche wrote:

Mike:

If you do the work on the main thread with an indeterminate progress indicator, it won't animate, so will look wrong. It's less noticeable than with a regular progress indicator, but it's still going to seem strange. If it's only going to be a half second, you can probably get away with it, but if it's going to be 5, it's going to look wrong to your user, since it's going to look frozen.

The deferred option basically tells the nib not to instantiate the window until the first time it is shown - it's really just a pointer or proxy (not sure how it's implemented under the hood, to be honest) until the first time it needs to be shown, such as in response to a makeKeyAndOrderFront: message or when it's used in a sheet.

Jeff


On Jan 24, 2006, at 9:03 AM, Mike Abdullah wrote:

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,


_______________________________________________ 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
References: 
 >Conceptual question (From: Mike Abdullah <email@hidden>)
 >Re: Conceptual question (From: Mike Abdullah <email@hidden>)

  • Prev by Date: performSelector in next run loop?
  • Next by Date: Re: Running COCOA application during startup
  • Previous by thread: Re: Conceptual question
  • Next by thread: Optimizing text layout in a log view: should I subclass NSLayoutManager?
  • Index(es):
    • Date
    • Thread