I am currently working on a document-based app. I have set it up so that the modified property gets set to true when one or more text fields are changed. So far, so good – the red wiget updates accordingly. If I click on the red wiget a sheet, attached to the window, is displayed asking if I want to save the changes (as it should ask). I am given three options: don’t save, cancel and save…
Cancel and Save work fine. If I click on the “don’t save” option, however, another sheet, also attached to the window, is displayed BEHIND the first sheet. I can’t read the second sheet and I don’t know how to properly handle the “don’t save” option. I have tried attaching a “panel ended” event to the window as well as a “should close” event. I have a “will close” event attached to the window that is getting called but there is no way (that I know of) to tell what button from the sheet has been pressed.
I hope what I am saying makes sense and the really hope that someone can help me out here.
An update: In the “will close” event I have a “quit” command. I have figured out (I think) what is happening: The doc is modified; the red wiget is clicked to close the doc; I am asked if I want to save the changes – I select “don’t save”; the “will close” event is called and when the “quit” command is issued, I am again asked if I want to save the changes.
So, what’s the work-around for this? I would like to be able to quit the doc by clicking the red wiget. Is that not possible in a doc-based app?