• 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
Threaded Access to Display Elements
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Threaded Access to Display Elements


  • Subject: Threaded Access to Display Elements
  • From: Chris Williams <email@hidden>
  • Date: Sun, 23 Sep 2007 13:56:27 -0700
  • Thread-topic: Threaded Access to Display Elements

I'm struggling with some display problems in my multi-threaded application.

I have a status bar and a progress bar in the bottom of my app's window.
The status field (an NSTextField) is always there, updated as the user
changes the active selection, or when a long operation is completed to
report the status.  The progress bar is hidden, only present when they do
some lengthy operation.

The lengthy operations are done in a separate thread, of course.  This works
fine, except with respect the to the updates to these two interface
elements.  Updates to these fields is rather random.  It works perfectly
sometimes, and is all messed up at others.  Of course, if I do the
operations synchronously, all is well.

For example, occasionally the status field is all overdrawn (e.g. the old
text is still there, the new text scribbles all over it, making a mess).
Not always, just some times.  The one that is driving me most nuts is the
progress indicator.  It works, updates correctly, but I want it to hide when
the operation is complete.  I "setHidden" and then do a "display" on the
progress bar, in the worker thread when it is done.  Sometimes it works,
other times it doesn't, the progress bar remains on the screen.

Clearly I have conflicts with these controls because of the threaded nature.
And so, my question is, what is the best way to handle this kind of
interaction, to be sure the controls are properly updated from down in a
worker thread?

Thanks,
Chris
_______________________________________________

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

  • Follow-Ups:
    • Re: Threaded Access to Display Elements
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Re: insert a plist in a NSTableView using a NSDictionary
  • Next by Date: Re: insert a plist in a NSTableView using a NSDictionary
  • Previous by thread: Lazy undo for Arrays
  • Next by thread: Re: Threaded Access to Display Elements
  • Index(es):
    • Date
    • Thread