[REBOL] Re: Hide a face inside its action event?
From: rotenca:telvia:it at: 16-Jan-2002 0:37
Hi Gregg
> Is it possible to hide a face when you're responding to an action for that
> face? E.g. clicking a button performs some actions, one of which is to hide
> the button itself. I can't seem to make it work. Other faces hide just fine,
> but not the one that is engaged.
look at the standard engage of button:
func [face action event][
switch action [
time [if not face/state [face/blinker: not face/blinker]]
down [face/state: on]
alt-down [face/state: on]
up [if face/state [do-face face none] face/state: off]
alt-up [if face/state [do-face-alt face none] face/state: off]
over [face/state: on]
away [face/state: off]
]
cue face action
show face ;<-----------
]
after every engage event, catched or not catched by switch, the face is shown.
You
hide and engage show!
You could do:
view layout [button "hide" [hide face] feel [engage:
func [face action event][
switch action [
time [if not face/state [face/blinker: not face/blinker]]
down [face/state: on]
alt-down [face/state: on]
up [if face/state [do-face face none] face/state: off]
alt-up [if face/state [do-face-alt face none] face/state: off]
over [face/state: on ]
away [face/state: off]
]
cue face action
;show face ;<----------- commented out
]]
---
Ciao
Romano