NSTask blocking GUI ?? (Bindings related?)
NSTask blocking GUI ?? (Bindings related?)
- Subject: NSTask blocking GUI ?? (Bindings related?)
- From: Steven Palm <email@hidden>
- Date: Wed, 8 Dec 2004 21:51:17 -0600
I thought you could fire off an NSTask process, set up it's
pipes/filehandles with notify in background, and your main runloop and
GUI wouldn't block...
I have an app in which GUI components are updated via way of using
Cocoa bindings. I fire off an NSTask() and it runs in the background,
and my program seems to be doing all the right things, but the GUI
elements don't update unless I click on another window. Some of the
widgets which have their "enabled" setting controlled via Cocoa
Bindings don't even update then, they only update if I select something
else in the list view and then back to the item which has changed as a
result of the task.
The app is a vpn client... I have an ArrayController for the various
configurations, and each config will fire off an NSTask() upon request
from a Start button. The GUI has a line for each config, along with a
graphic to indicate status (using a value transformer from instance
variable to image path).
When I hit start, the NSTask fires, connects fine, but the graphic in
the GUI doesn't change, nor do the buttons update as they should when
the task goes "live". However, if I pick another config in the GUI, or
even click another window outside the app, the GUI updates instantly
(well, the graphic does, not necessarily the 'enabled' status of
buttons).
Is this enough to work on?
I thought I might have to fire off a separate thread for the background
process, but doing that didn't seem to change things at all, but even
made them worse do to an issue documented here:
http://www.cocoadev.com/index.pl?NSTask
Something about the NSTask notifications going back to the thread that
started them, but my thread (since it ends as soon as the task
completes) is not there to catch the notification and thus crashes.
Thanks for any hints/helps!
Steve
_______________________________________________
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