Re: sheets
Re: sheets
- Subject: Re: sheets
- From: Daniel Zitter <email@hidden>
- Date: Mon, 2 Jun 2003 18:29:09 -0700
Date: Mon, 2 Jun 2003 13:37:31 -0400
Subject: sheets
From: Brent Gulanowski <email@hidden>
To: email@hidden
Not a specific question, more one of strategies. I have been playing a
bit with sheets, and have become confused by how to cope with their
asynchronous nature. I feel that I am losing the thread of my workflow
when I post a sheet and the method returns immediately.
Brent,
The response from Clark S. Cox III is right on the money.
From my own experience I would add that you need to encapsulate the
workflow state required to implement whatever the outcome of the user's
interaction with the sheet may be and pass it along as the context info
of the -[NSApplication
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:] or
NSBeginAlertSheet().
TextEdit's DocumentSaveInfo is one example of some contextual
information.
Check out Document.m:- (void)didEndSaveSheet:(NSSavePanel *)savePanel
returnCode:(int)returnCode contextInfo:(void *)contextInfo; in
particular.
You could use notifications to achieve results similar to using context
information but it almost certainly ends up being more complex. (All
the goods probably end up in the userInfo dictionary anyway, which is
less flexible than void *)
Cheers,
Dan
_______________________________________________
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.