Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Vid / Subpanels / Dirty?

From: brett:codeconscious at: 1-Jun-2001 15:08

Hi Colin, 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 at present. dirty-flag: false 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 ] RETURN is-ready ] view layout [ test-field: field [dirty-flag: true] do [ insert-event-func [ either event/type = 'close [ last-face: system/view/focal-face if all [ last-face not none? get in last-face 'action] [ last-face/action last-face last-face/data ] if ready-to-continue? [quit] ][event] ] ] ] 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. Regards, Brett