[REBOL] /view radio button values Re:

2000-08-02 Thread gkoplas


- Original Message -
From: <[EMAIL PROTECTED]>

> How can I retrieve the value of a radio button?
>
> Using the following...
>
> view layout [
> text "copy"
> copy-ack: radio of 'effects
> filter-ack: radio of 'effects
> button "do it" [print copy-ack]
> ]
>

The property you're looking for is "/state", and the value will be usable as
a boolean
(I'm not sure if it actually uses the values "true" and "false", or "yes"
and "no", or whatever, so I've hard-coded "true" in my update to your layout
rather than using to-string).

Note that you can also set this value in a block when declaring the radio
button to set the default option, as shown.

e.g.


view layout [
text "copy"
copy-ack: radio of 'effects [state: true]
filter-ack: radio of 'effects [state: false]
button "do it" [if copy-ack/state
[print "true"]
]
]

<

... or whatever it is you'd really like to do with it.

Hope that's what you were looking for.

-- Geoff Koplas




[REBOL] /view radio button values

2000-08-01 Thread RChristiansen

How can I retrieve the value of a radio button?

Using the following...

view layout [
text "copy" 
copy-ack: radio of 'effects
filter-ack: radio of 'effects
button "do it" [print copy-ack]
]

I try to retrieve the value of copy-ack in the console, but it prints only that it 
is an ?object?

And so I try this...

view layout [
text "copy" 
copy-ack: radio of 'effects
filter-ack: radio of 'effects
button "do it" [probe copy-ack]
]

Using 'probe instead of 'print makes /View lock up solid. It also felt like it was 
taxing my system's RAM before I killed /View.

The documentation for radio buttons in /View is very limited. Can anyone 
help me?

-Ryan