Hi Yvan,

you've already heared a bit about one way to do it, so here's the other ;-)

[REBOBL[]
title-txt: ""
format-txt: "Just to show default text"

view layout [
     text "title"  field title-txt
     text "format" field format-txt
     button "OK" [
         if all [
             not empty?  title-txt
             not empty? format-txt
         ][
             unview/all
         ]
     ]
]

probe title-txt
probe format-txt
]

To clarify a little ...

view layout [
        title-fld: field
]
probe title-fld/text

Here, title-fld is set to the "face" (the visual object you see on the  
screen),
and most faces store the text they display in there 'text attribute

title-txt: ""
view layout [
        field title-txt
]
probe title-txt

Now title-txt is connected to the face, in a way, that the face displays  
the content
of title-txt, and all changes you make in the field are automagically  
propagated to
title-txt. You should be aware, that title-txt should be set to a string  
before using
it like this. (Just try title-txt: 9 and see what happens ;-)


Kind regards,

Ingo



On Wed, 03 May 2006 18:35:08 +0200, Yvan <[EMAIL PROTECTED]> wrote:

>
> Hello,
>
> this has to be a very very basic newbie question, at least I hope so.
>
> Okay, consider the following piece of code:
>
> view layout
> [
>  text "title" field
>  text "format" field
>   button "OK"
> ]
>
> All I want to achieve is:
>
> when clicking the OK button,
> - the values entered in the two fields should be saved in two different
> variables
> - the layour should be closed
>
> How can I achieve that?
>
> Cheers
> Yvan
>
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to