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

how to get check box state? - mycheckbox/data

 [1/2] from: arolls::bigpond::net::au at: 24-Aug-2001 15:05


view layout [c: check [print either c/data ["on"]["off"]]]
> > hi. how do you get the state of a checkbox in view. > > I'd like to do something like this but it doesn't
<<quoted lines omitted: 17>>
> though it isn't much use, except to save the value somewhere else: > mycheckbox: check [SavedValueforCheckbox: value]
You could use it to enable or disable a group of options. view layout [check [print either value ["enable"]["disable"]]]

 [2/2] from: sanghabum:aol at: 24-Aug-2001 5:51


[arolls--bigpond--net--au] writes:
> > 'Value only works in the action facet for the item itself. So > > this would work:
<<quoted lines omitted: 7>>
> view layout [check [print either value ["enable"]["disable"]]] > --
Hi there, That's true. I guess the point I was stumbling to make was that 'value exists only in the Action Facet. So you either have to use it there or lose it. But if your checkbox (or whatever) is named, the value is retained in the /Data variable. Compare these two bits of code: unview/all myaction: func [req] [print ["requested: " req]] view layout [choice "a" "b" "c" [myaction first value] ] unview/all myaction: does [print ["requested: " first mychoice/data]] view layout [mychoice: choice "a" "b" "c" [myaction] ] The first passes the value out as a function parameter; the second ignores the value and uses a global variable by naming the checkbox. --Colin.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted