Output from NSTask and modal window
Output from NSTask and modal window
- Subject: Output from NSTask and modal window
- From: "Sven-S. Porst" <email@hidden>
- Date: Tue, 15 Jan 2002 01:40:23 +0100
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?