[REBOL] Re: Vid / Subpanels / Dirty?
From: brett:codeconscious at: 1-Jun-2001 15:08
Reading you post literally I think you may have the same problem I
encountered and that Scott referred to.
Try this test in you application to check:
1) Start a fresh version of you application.
2) Type something into a field but WITHOUT hitting TAB or ENTER, nor
clicking anywhere else.
3) Close the window.
4) Does you application correctly trap the dirty state?
If not, here is an example of something equivalent to the solution I'm using
ready-to-continue?: function [/nocancel] [is-ready save-it] [
either dirty-flag [
if save-it: either nocancel [
request/confirm "Save changes now?"
request "Save changes before continuing?"
] [ alert "Save data now - stub" ]
is-ready: not none? save-it
][ is-ready: true ]
view layout [
test-field: field [dirty-flag: true]
either event/type = 'close [
if all [ last-face not none? get in last-face 'action] [
last-face/action last-face last-face/data
if ready-to-continue? [quit]
I'm interested though if others have a better solution. In particular I'm
unsure of if I should use insert-event-func or code a detect function.
Probably ends up the same.