How do you program a save dialog when no changes in the file has been made?
Björnke von Gierke
bvg at mac.com
Sun Nov 7 18:10:56 EST 2010
you need to set a flag, for example, if this would be in a text editor, i'd set a "dirty" flag on rawkeydown of the main text entry field, and then when the stack (window) is closed i'd check for that flag:
--in the field
on rawkeydown theKey
set the dirty of me to true
pass rawkeydown
end rawkeydown
--in the stack
on openstack
set the dirty of field "text" to false
end openstack
on closestackrequest
if the dirty of field "text" then
-- do the save dialog here
else
pass closestackrequest
end if
end closestackrequest
note: this is a simplified example, and does not cover all real life possibilities
On 7 Nov 2010, at 23:46, charles61 wrote:
>
> I have code in my save menu that brings up a dialog for saving a file with
> "Don't Save", "Cancel" and "Save". After the user saves the file the first
> time, the code will automatically insert the name of the file into the
> dialog above when the user wants to save it again or get ready to open a new
> file. Any time the user gets ready to close the file or open a new file the
> dialog above (Don't Save, Cancel and Save) appears. How do I code it so that
> when the user does NOT make a change to the file (preserving the save file)
> the dialog of Don't Save, Cancel and Save will not appear and the file will
> go ahead close or a new file dialog will appear?
--
official ChatRev page:
http://bjoernke.com?target=chatrev
Chat with other RunRev developers:
go stack URL "http://bjoernke.com/chatrev/chatrev1.3b3.rev"
More information about the use-livecode
mailing list