Re: Prevent Asynchronous operation of beginSheetModalForWindow
Re: Prevent Asynchronous operation of beginSheetModalForWindow
- Subject: Re: Prevent Asynchronous operation of beginSheetModalForWindow
- From: Jens Alfke <email@hidden>
- Date: Tue, 10 Jun 2008 15:46:58 -0700
On 10 Jun '08, at 1:27 PM, Michael Ash wrote:
If there were a synchronous API the code would have to
somehow jump down the stack to where you're waiting for A, while
somehow leaving the stuff that's waiting for B live farther up the
stack. This is quite simply impossible in a C-based language.
It's not impossible, but it would require either that every window ran
in a separate thread (as in the BeOS) or that the Cocoa frameworks
supported coroutines. Coroutines are quite feasible in C, using setjmp/
longjmp style trickery; but when I investigated this I saw that using
them would probably seriously confuse Objective-C's exception
handling, and possibly NSRunLoop too.
John, you should look at the Cocoa conceptual docs that describe the
use of sheets. There are probably a bunch of examples of sheet usage
in the sample code too, if you search for "beginSheetModalForWindow:".
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden