• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
A REALLY Basic question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: A REALLY Basic question
      • From: Sherm Pendley <email@hidden>
    • Re: A REALLY Basic question
      • From: Greg Titus <email@hidden>
References: 
 >Re: Sheets and NSPreferencePane (From: Thomas Harrington <email@hidden>)

  • Prev by Date: Confused in sheets
  • Next by Date: Dragging text strings from NSMatrix cells (solution)
  • Previous by thread: Re: Sheets and NSPreferencePane
  • Next by thread: Re: A REALLY Basic question
  • Index(es):
    • Date
    • Thread