check box setting
[1/5] from: fprowse:uu at: 28-Jun-2001 14:13
Guys, how do I set the value of a check box? Is there a doc that covers
this issue..? I have an example below I would like to use....if
function/text isn't equal to "HR" then then an alert will be generated and
the checkbox returned to an unchecked status.
Ideally I would like the checkbox to not even be "selectable" or even
visable unless function/text = "HR" however, I have not been able to work
out how to do this either :)
udc: label right 95x24 "UDC" check
[if function/text <> "HR"
[alert "Not valid for this device"
set udc/????? ????]
return ]
Any help appreciated
Francois
[2/5] from: philb:upnaway at: 29-Jun-2001 0:36
Hi Francios,
You will need to assign your check (box) a variable name .. for example
view layout [cb: check yes button "State?" [print cb/data] ]
If you dont want it enabled then you could use a different type of field an LED perhaps?
Cheers Phil
-- Original Message --
Guys, how do I set the value of a check box? Is there a doc that covers
this issue..? I have an example below I would like to use....if
function/text isn't equal to "HR" then then an alert will be generated and
the checkbox returned to an unchecked status.
Ideally I would like the checkbox to not even be "selectable" or even
visable unless function/text = "HR" however, I have not been able to work
out how to do this either :)
udc: label right 95x24 "UDC" check
[if function/text <> "HR"
[alert "Not valid for this device"
set udc/????? ????]
return ]
Any help appreciated
Francois
[3/5] from: jelinem1:nationwide at: 28-Jun-2001 14:09
In the couple of /View programs I've written, I've ended up assigning
words (ie variables) to all fields that change: checkboxes, input fields,
etc. In the absence of detailed docs for some of the /View functionality
(or maybe it's just me), I will end up looking at all the resulting
structures and hack at thier usage.
- Michael Jelinek
From: [philb--upnaway--com]@rebol.com on 06/28/2001 11:36 AM
Please respond to [rebol-list--rebol--com]
Sent by: [rebol-bounce--rebol--com]
To:
cc:
Subject: [REBOL] Re: check box setting
Hi Francios,
You will need to assign your check (box) a variable name .. for example
view layout [cb: check yes button "State?" [print cb/data] ]
If you dont want it enabled then you could use a different type of field
an LED perhaps?
Cheers Phil
-- Original Message --
Guys, how do I set the value of a check box? Is there a doc that covers
this issue..? I have an example below I would like to use....if
function/text isn't equal to "HR" then then an alert will be generated and
the checkbox returned to an unchecked status.
Ideally I would like the checkbox to not even be "selectable" or even
visable unless function/text = "HR" however, I have not been able to work
out how to do this either :)
udc: label right 95x24 "UDC" check
[if function/text <> "HR"
[alert "Not valid for this device"
set udc/????? ????]
return ]
Any help appreciated
Francois
[4/5] from: arolls::bigpond::net::au at: 29-Jun-2001 13:44
view layout [
c: check
t: choice "HR" "ab" "cd" [
either t/text = "HR" [show c][hide c]
]
]
I don't advise using "function" as a gui
object name, because it is a rebol
predefined word.
>> ? function
USAGE:
FUNCTION spec vars body
DESCRIPTION:
Defines a user function with local words.
FUNCTION is a function value.
ARGUMENTS:
spec -- Optional help info followed by arg words (and optional type and
string) (Type: block)
vars -- List of words that are local to the function (Type: block)
body -- The body block of the function (Type: block)
Anton.
[5/5] from: carl:cybercraft at: 29-Jun-2001 18:06
On 29-Jun-01, [philb--upnaway--com] wrote:
> Hi Francios,
> You will need to assign your check (box) a variable name .. for
<<quoted lines omitted: 3>>
> field an LED perhaps?
> Cheers Phil
The above works, but is it just me who finds the use of 'data instead
of 'state odd for a check box? The default values are none for 'data
yet false for 'state, which suggests it's meant to be 'state but
View's altering 'data instead. This show's what I mean...
view layout [
text "Click on the check box and watch the output."
x: check [print reform ["x/data:" x/data "x/state:" x/state]]
do [print reform [
"Default Values: x/data:" x/data "x/state:" x/state
]]
]
Which gives me this output...
Default Values: x/data: none x/state: false
x/data: true x/state: false
x/data: false x/state: false
x/data: true x/state: false
x/data: false x/state: false
etc...
So, is it a bug, or am I missing something and a check box with a none
as its default makes sense?
> -- Original Message --
> Guys, how do I set the value of a check box? Is there a doc that
<<quoted lines omitted: 11>>
> Any help appreciated
> Francois
--
Carl Read
[carl--cybercraft--co--nz]
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted