Re: Allowing cancel and progress but not updating display
Re: Allowing cancel and progress but not updating display
- Subject: Re: Allowing cancel and progress but not updating display
- From: Andrew Madsen <email@hidden>
- Date: Sat, 10 Mar 2007 13:37:57 -0700
On Mar 10, 2007, at 9:59 AM, Kevin Hoctor wrote:
All this works well when the stars align. I think the problem is
that my UI is updating as the import is happening and I'm getting
threading errors. I either need a way to keep my controllers from
updating during this process or I need a single thread method that
allows me to update the progress panel and allow the user to cancel
the process. My experiments with detaching/reattaching bindings
programatically have failed (and looked ugly anyway). Is there a
modal way to do this?
I do something similar (from a user perspective) in one of my apps.
Instead of using a separate thread for the import, I simply put up a
window and run it as a modal session. This way, I can make it so the
progress panel continues to respond to events during the import
process. Check out the docs for the NSApp methods
beginModalSessionForWindow: and runModalSession:.
<http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#//
apple_ref/occ/instm/NSApplication/runModalSession:>
<http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#//
apple_ref/occ/instm/NSApplication/beginModalSessionForWindow::>
-Andrew Madsen
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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