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

[REBOL] Rebol view fields are caching entries - HELP

From: yvan_iigs:gmx at: 12-Nov-2006 16:45

Hello together, I think I'm turning in circles. I want to open a layout with a field where I can enter a filename and a button 'Edit' to open the file with the filename I entered and allowing me to edit it. The editing stuff works more or less, but I have a very strange problem. To explain it I created to very crude functions with just enough code to show you the problem. The functions: select-file: a layout with a field where I can enter the filename. A default value of none is used. A button 'EDIT' which by pressing it would call a function 'edit-file' with the filename I entered or doing nothing if the default value of none is still in it. A button 'CANCEL' which just quits the function edit-file: Would do the editing stuff, but as this is not the problem I just entered dummy code, Okay, what is the problem. -Start "select-file" for the first time -> a view opens with a filename in the field of "none" as expected. -Now enter dada as filename and press EDIT -> works as expected -Now, start "select-file" a second time -> a view opens with a filename in the field of 'dada' instead of 'none' ,and this is very disturbing, unexpected stuff. I tried many things, clearing strings, enabling trace, jumping out of the window, but I am not able to find the reason of this problem. what I want is that every time I start this function the default value of 'none appears in the field. Who can help me please. Cheers Yvan PS: The code: file 'createfile.r' REBOL [title: "Creates File"] select-file: func ["enter name manually and then edit"] [ view layout [ text "filename" filename: field "none" button "Edit" [ if/else NOT (filename/text = "none") [ unview edit-file filename/text ] [ view layout [ text "No filename selected" button "OK" [unview] ] ] ] button "CANCEL" [unview] ] ] edit-file: func [ filen ] [ print "Will do some editing stuff" ] Mit freundlichen Gr=FCssen Yvan=