[REBOL] Re: Checkbox state is not changing - maybe Allen Kamp updates his View
From: arolls:bigpond:au at: 6-Sep-2001 22:41
See comments below.
> >> >> view layout [ c: check [probe c/state]]
> >> > try c/data
> >> Quite inconsistent (... as so many aspects of VID ...) -
> toggles work with
> >> /state - but it works.
> > Not really.
> > I think state is whether gadget is "depressed"
> That's the _main_ problem regarding /View, VID etc. We only _think_
> about things instead of _knowing_ it surely - with a knowledge
> based on sound
> and behind-the-scenes _information_ (back to basics, i.e. /View's
> sparse documentation ... ;-) )
Just be aware that you are asking for people to
do work for you. Although it would benefit all
of us, not just you, it is still work to prepare
However, I am listening. I have been doing some
docs, they just aren't ready yet. :)
> > or not. The check cannot be pushed down in
> > current implementation, therefore its state
> > should not change.
> Then we should inform Allen Kamp that his information on Rebolforces'
> View FAQ is incorrect. I tried his checkbox-setting routines on /View
> 188.8.131.52.1) and neither his methods is working:
> First: it shows the layout, but check apears not checked
> view layout [chk1: check with [state: true]
Should now be:
view layout [chk1: check with [data: true]]
> Second: simply error ;-(
> >> checkers: stylize [
> [ true-check check [state: true]
> [ ]
> == 
> >> view layout [styles checkers
> [ chk1: true-check chk2: check]
> Unknown word or style: true-check
Ok, the above should now be:
checkers: stylize [
true-check: check with [data: true]
view layout [
You might want to send feedback to Allen with this,
if he is not already on to it.
> have only one explanation for this behavior of all his code snippets:
> In /View 1.x where x<>2 but some earlier release, checkbox's 'state
> property _worked_ as expected. Maybe this /View release is buggy in
> this respect.
Yes, in an earlier release, check's state property worked that
way. Whether or not you expected it is a matter of religion.
Allen's old code is now out of date, because of the more
consistent treatment of the data attribute in the latest View.
> Thus the current one of the checkbox-checking solutions is with 'data :
> view layout [c: check do [c/data: true]]
> > view layout [b: button [probe b/state]]
> > It's always true, because:
> > - first you press button, state becomes true (button looks depressed).
> > - you let go of button, action occurs.
> > - then state becomes false (button looks normal/ready again).
> I think your code is rather instructive but: 'probe is fired
> AFTER you have released the button thus button is in "up"-position. In
> this respect 'state again "lies": it should have been always FALSE.
No, because button does its action block before
changing the button visual to the "up" position.
Try this, which simulates code that takes a while
view layout [button [wait 1]]
So the sequence is:
- user presses mouse button on button
- button changes visual state to "down"
- user releases mouse button over the button
- button does action block
- button changes visual state to "up"