Re: modal windows (again)
Re: modal windows (again)
- Subject: Re: modal windows (again)
- From: Devon E Bowen <email@hidden>
- Date: Tue, 9 Mar 2004 11:52:05 -0500 (EST)
Thanks for the response but it didn't exactly clear up my problem.
>
This is a high-traffic list, a subject like "Modal windows" are not
>
going to attract much attention.
I tried "enlarge your manhood" but that didn't seem to help either. 8-)
>
Modal is the opposite of non-blocking -- if you want a non-blocking
>
panel to appear, you should not use a function which returns a window
>
prepared for a modal session.
>
>
You'd normally use IB to create non-blocking panels.
Well, that sort of makes sense. But then you say:
>
This method is for the case where e.g. you'd need to do a lot of work
>
in the main thread but still wants your GUI to be responsive
So the purpose of runModalSession is to make sure a modal window does
not block. And runModalSession is exactly the method that is recommended
to be used in the NSGetAlertPanel() manual entry. So, in other words,
the manual clearly says that I can use NSGetAlertPanel() to make a modal
panel that does not block the application. Your code sample agrees:
>
session = [NSApp beginModalSessionForWindow:aWindow];
>
while(stuffToBeDone() && [NSApp runModalSession] == NSRunContinuesResponse)
>
doStuff();
>
[NSApp endModalSession:session];
The only difference between this and what I'm doing is that I call
runModalSession from inside a timer that goes off every tenth of a
second rather than in a tight while loop. I am starting to get the
impression that I can't do this, though. That runModalSession can
*only* be called the way you have written it above. Although that
seems extremely limiting. It means, I can't handle network events,
etc, while a modal window is displayed.
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.