A REALLY Basic question
A REALLY Basic question
- Subject: A REALLY Basic question
- From: Mark Malson <email@hidden>
- Date: Sat, 20 Jul 2002 14:53:23 -0400
I know this is basic... In the past, I think I have either gotten around
these issues or avoided them altogether (UI hasn't been my specialty in the
past..)
My question is: How far do I need to go with this event-driven programming
stuff for UIs?
E.g., I'm trying to save a document. I have a method called saveDocument
which is invoked from the menu selection. I want to pre-flight the document
before I save it, so I might have to put up an alert sheet if there are any
problems. If he answers "Go ahead and save" my quandary begins.
In saveDocument, the main path would be to do the pre-flight, and if
everything is OK, then save the document.
If my pre-flight puts up an alert sheet, then I can't rely on returning to
saveDocument at a meaningful time -- After NSBeginAlertSheet is called, that
function exits, I go back to saveDocument, and all the way through while I'm
waiting for the user to hit a button. I don't know if he wants to actually
save the questionable document until the response method is called.
So I have to duplicate code in saveDocument and in the response method , or
at least call it from two different places to do the same thing.
Am I missing something? Is there an alert sheet function that will wait for
the user's response? Or am I just longing for the stone tool of Alert() in
OS 9?
_______________________________________________
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.