Re: Output from NSTask and modal window
Re: Output from NSTask and modal window
- Subject: Re: Output from NSTask and modal window
- From: Christophe Dore <email@hidden>
- Date: Fri, 18 Jan 2002 10:43:06 +0100
I,
what I meant is that when you call runModalSession, it puts the current
run loop in ModalPanelMode.
Thus, the runloop does not care any more for things that are only to be
watched in NSDefaultRunLoopMode.
Then, I only suspect that NSPipes are attached to the run loop in
default mode.
If you want to simulate a modal panel without changing the current mode,
you can :
- set the level of the panel to NSModalPanelWindowLevel
- make it key and order front,
- filter the NSEvents in sendEvent: method of NSApp, to only deliver
those events that are about your panel,
until you click one of those famous OK/CANCEL... buttons that would make
this pseudo modal mode stop.
Hope this helps.
Sven-S. Porst wrote:
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:
Thanks, I had a look at these topics after Christophe's hint yesterday.
My impression was that run loops are nothing I want/should manipulate
myself (given that I know nothing about ports and stuff) but only be
aware of their existence and the trouble they may cause.
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.
Perhaps I'm blind but I don't see one. All I find are runModalForWindow:
and the [begin|run|stop]ModalSession ones, none of which allow me to
specify a run loop mode. There's still the strange NSModalSession type,
which isn't documented as far as I can tell - so it might be hidden in
there - or there are the NSEventTrackingRunLoopMode and
NSModalPanelRunLoopMode constants in the NSApplication documentation
which are 'description forthcoming'. Could you please point me to the
method you have in mind as I am not very successful at finding it?
[As you may have read by now, I figured out a way to make things work but
I suspect that it is to be considered a 'workaround' rather than a
'solution' of the problem given that it causes my app to use lots of
processing time for doing nothing - so I am still interesting in finding
a proper way to do this.]
Thanks for any help.
Sven