Re: Output from NSTask and modal window
Re: Output from NSTask and modal window
- Subject: Re: Output from NSTask and modal window
- From: Matt Rollefson <email@hidden>
- Date: Wed, 16 Jan 2002 16:19:00 -0800
You want to take a look at the documentation for modal run loops and the
different modes they support. Check out the following topic on run loops:
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/
InputControl/index.html
Specifically, look at the information on runloop modes, and check out
the different ways in NSApplication to run a modal window -- at least
one allows you to specify the runloop mode.
Rollie
On Monday, January 14, 2002, at 04:40 PM, Sven-S. Porst wrote:
Hi,
I mentioned the following problem in the discussion on NSTask and NSPipe
a fortnight or so ago and after digesting all the information of the
previous discussion I can now specify the problem more precisely.
I am running a CLI application using NSTask. Acutally I am not only
running that app but interacting with it, so I am not simply launching
it
and waiting that it's finished. I wrote my own class that sets up the
task, lauches it and handles the interaction. After the task is finished
a notification with the result is sent.
Now the problem: When running the task, my class will not be notified
immediately of its output. (In the other thread it has been mentioned
that this may be caused by stdios buffering, but this isn't the case
here
- the CLI application I run emits newlines after each line of its output
and calls fflush afterwards). I will only receive the notification after
using the application's menus (yep, this sounds unlikely - and it took
me
a while to 'discover' this).
A bit of extra experimenting showed that the notifications getting
'stuck' is probably caused by the fact that I am having a modal window
on
the screen while my task is being run. Everything works flawlessly when
the window isn't modal.
So I could do with a bit of advice here:
. Am I doing something I am not supposed to do when using a modal
window?
. Is this a bug in the modal windows?
. Is there any other way to do this, avoiding this problem [my
impression
is that I can't have a non-modal window as I need to open the window,
get
info from the user, process it and then determine the result of my
function from that. I can't just use some notification of the result as
all this is for running a service and I have to have the result ready by
the time the functions that's been initially called returns].
Thanks in advance
Sven
--
Sven-S. Porst . PGP: 0x0085ABA3 . http://homepage.mac.com/ssp
Does anybody remember laughter?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.