How do you program a save dialog when no changes in the file has been made?
charles61
cszasz at mac.com
Mon Nov 8 10:13:43 EST 2010
Björnke,
Thanks! This gives me a starting point on how to do this.
Charles Szasz
cszasz at mac.com
On Nov 7, 2010, at 6:11 PM, Björnke von Gierke [via Runtime Revolution] wrote:
> 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"
>
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
> View message @ http://runtime-revolution.278305.n4.nabble.com/How-do-you-program-a-save-dialog-when-no-changes-in-the-file-has-been-made-tp3031279p3031306.html
> To unsubscribe from How do you program a save dialog when no changes in the file has been made?, click here.
>
--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/How-do-you-program-a-save-dialog-when-no-changes-in-the-file-has-been-made-tp3031279p3032092.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode
mailing list