Re: NSPanel as Sheet and controlling the run loop
Re: NSPanel as Sheet and controlling the run loop
- Subject: Re: NSPanel as Sheet and controlling the run loop
- From: "M. Uli Kusterer" <email@hidden>
- Date: Wed, 7 Apr 2004 17:50:33 +0200
At 16:38 Uhr +0200 07.04.2004, Alexander F. Hartner wrote:
I have a NSPanel which I created in InterfaceBuilder. It contains a
progress bar. The progress of the progress bar is controlled from a
while loop. Now I would like to display the NSPanel as a model sheet
via,
I think you're using the wrong API. "modal windows" are the ones
that put your entire application into a mode that requires the user
to deal with the window before being able to do *anything* else.
What you want to do appears to be a better fit for the sheet
methods. There are equivalent methods to runModal... for sheets
(runSheetForWindow: or something like that).
-Using NSThread to display the panel. This caused a number of problems,
but I think there must be a nicer solution
GUI may only be done from the main thread. What I'd suggest you do
is run the actual work in a separate thread, and occasionally call
selectors on the main thread that update the progress bar
accordingly, or close the sheet in the end. There's probably a better
way to do this than threads, though. Depends upon what you're
actually doing.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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.