[ALLY] Re: How can I hide the field?
[1/5] from: cyphre::volny::cz at: 9-Apr-2001 14:10
Hello,
Just write
l: layout [ f: field with [show?: false] t: text "test"]
view l
Regards
Cyphre
[2/5] from: brett:codeconscious at: 9-Apr-2001 21:09
I have the following:
l: layout [ f: field t: text "test"]
hide f
view l
I expected that the field would be hidden but alas not. How do I hide the
field?
Thanks
Brett.
---
http://www.codeconscious.com
[3/5] from: arolls:bigpond:au at: 9-Apr-2001 22:42
You can hide/show, like this (press the button):
view layout [f: field button [hide/show f]]
or look at this:
rebol [
Author: "Allen Kamp"
]
view layout [
button "Click me to hide!" 120
feel [engage: func [f a e][hide f ]]
]
;a bit more elaborate
view layout [
button "Click me to hide!" 120
feel [
engage: func [face action event][
switch action [
down [face/state: on]
alt-down [face/state: on]
up [if face/state [hide face exit] face/state: off]
alt-up [if face/state [hide face exit] face/state: off]
over [face/state: on]
away [face/state: off]
]
cue face action
show face
]
]
]
or my way:
code: [
lay: layout compose [
t: toggle "button" "field"
g: (either t/text = "button" [[button "button"]][[field "field"]])
button "review" [unview/only lay do code view lay]
]
]
do code
view lay
Hope it solves your problem.
Anton.
[4/5] from: cyphre:volny:cz at: 10-Apr-2001 9:46
Hi Brett,
Just little reminder...
But be careful of pressing TAB key while you have in layout more than on
field and any of this fields is shown. Pressing the TAB will jump to the
hidden field and show it...maybe some kind of VID "feature" ;-)
BTW have you someone simple solution for that?
this is an example:
----
l: layout [ f: field f2: field with [show?: false] t: text "test"]
view l
----
click into field to activate it and press TAB...
[5/5] from: allenk:powerup:au at: 10-Apr-2001 9:58
Hi Brett,
Until the layout has been shown 'hide won't have any effect.
So you could do it this way to keep that face from showing.
l: layout [ f: field with [show?: false] t: text "test"]
view l
Once shown 'hide works as expected. e.g
l: layout [ f: field t: text "test"
button "Hide F" [hide f]
]
view l
Cheers,
Allen K
this is fun!