save dialog problem
Rich Lague
laguer at ucs.orst.edu
Sun Sep 11 14:28:58 EDT 2005
I have been trying to set up a “do you want to save” dialog in an
application that will run on both Macs and Windows. I get a result that
don’t really work from both shutdownRequest and closeStackRequest.
First I tried closeStackRequest:
[in the stack script of the substack where data is stored.]
on closeStackRequest
if the changedProp of this stack is true then
answer “Do you want to save” with “yes” or “no”
[more stuff here]
pass closeStackRequest
end closeStackRequest
When I tested this in Revolution (before building a standalone,) it did
not work when I quit or closed the subsatck. But it did work if I put
closeStackRequest in the message box.
I went ahead and made standalone apps. In windows my dialog appeared if
I quit by clicking the “X” in the upper right hand corner of the
window. It did not appear if I selected “quit” from the menu.
On the Mac much the same thing was true: No dialog if I quit from the
menu, but it does appear if I click the little red “close” button in
the upper left hand corner of the window.
So, I looked in the list archives and in the documentation and came up
with the idea of using shutdownRequest instead of closeStackRequest.
I kept everything the same but I substituted shutdownRequest for
closeStacckRequest.
On Windows the result was the same-- I get me dialog only by clicking
the “X”, and I do not get it if I pick “quit” from the menu.
On the Mac (system 10.2.8) I nolonger get the dialog from clicking the
little red button, but I do get it when I quit. (This is OK because
this substack is the main window and the natural thing to do is quit
rather than click the red button in the upper left hand corner.)
Finally, my question---
How do I get a windows standalone that displays the dialog when it
quits either from clicking the “X” or from selecting quit?
Should I use both handlers? (shutdownRequest and closeStackRequest.)
Or, would that just make the dialog appear twice?
Thanks!
Rich Lague
More information about the use-livecode
mailing list