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

Problem with dirty?

 [1/2] from: reboler::programmer::net at: 10-Apr-2002 13:28


The View Documentation says the following: dirty? A LOGIC flag that indicates that the text of the face has been modified. Whenever editing is performed upon a text face, this flag will be set to TRUE. I read last years thread about "Bug in Area", and got some tantalizing clues but... I have a 'box (view-box) with one of two panes (picture-pane or text-pane). 'text-pane is an 'area, modified with flags: [field]. When I do the following ... view-box/pane: text-pane I edit the text in text-pane I check the state of 'dirty? ... I always get 'none This is true for view-box/dirty?, view-box/pane/dirty?, or text-pane/dirty?. Here is the code I check it with ... if text-pane/dirty? [ if request {File was changed! Save it now?} [exit] ] ..., the above being part of a function. The 'request is never called, even after editing the text in text-pane. Does anyone have any ideas why? Something to do with panels/panes? Do I need to set the dirty? flag myself? If so, what event do I need to catch? (face = text-pane event = 'down ???) Thanks in advance for your time.

 [2/2] from: brett:codeconscious at: 11-Apr-2002 22:12


Hi Alan, I believe that dirty? is reset whenever the face is shown. Thus it cannot be used as an application level dirty flag. You could maintain your own dirty flag via action blocks or alternatively just read every field/area etc before saving and compare the value with an old version of the value. Have a look at the section "Dirty Faces" in http://www.codeconscious.com/rebsite/view-notes.r HTH Brett.