Re: modal windows (again)
Re: modal windows (again)
- Subject: Re: modal windows (again)
- From: Devon E Bowen <email@hidden>
- Date: Wed, 10 Mar 2004 10:53:37 -0500 (EST)
>
Threads are your friend for this type of thing and not that hard to
>
implement in reality. I believe your product will be a much better
>
citizen as a result. No need for daughter processes.
Thanks for the encouragement. I spent some time today reviewing threads
and run loops. I was thinking it might be nice to tuck the modal window
away in a thread. But I'm not sure how that would work. Information on
the details of loop modes is sparse. For example, if I were to run a
modal window in a thread, it's run loop would run in NSModalPanelRunLoopMode
and the main thread would continue in NSDefaultRunLoopMode. Does that
not cause a collision of some sort since the threads documentation says
that only one thread can handle user events? Or is it smart enough to
send all GUI events to the modal thread and continue with my networking
events in the main thread? And then, when the modal session ends, smart
enough to start sending GUI events to the main thread again? Or would
I get modal events sent to the modal thread but still get other GUI
events sent to the main thread? I can think of a few ways this could be
implemented and I'm not sure which it is. Or is it not possible to
put a modal window in its own thread while the NSDefaultRunLoopMode is
still running?
>
With that said if you use some of the network services of Cocoa and
>
CoreFoundation they could take care of such thread / event management
>
for you. Using "NSModalPanelRunLoopMode" in NSFileHandle's
>
readInBackgroundAndNotifyForModes (etc.) should get the resulting event
>
to still be processed while app or window modal.
Ok, I'll use that as a backup plan.
In any case, your comments have been helpful...
Devon
_______________________________________________
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.