[REBOL] Re: newbie q : value & label in text-lists
From: carl:cybercraft at: 1-Apr-2004 8:40
On 01-Apr-04, [sags--apollo--lv] wrote:
> Thanks for answers!
> The next q. is about faces event handling:
> I would like to use a layout (form) without help of mouse.
> There was some points in couple of documentation files (view
> quide and handling events), but no so much.
> So I am interested to find some more detailed description or
> some examples about tabing (focusing) throught faces (not just
> text fields) and more info about "detect" event using.
> Could you please point me to a link that I missed.
It sounds like you missed this one...
http://www.rebol.com/how-to/feel.html
which covers event handling quite well. I don't know of any docs
where focusing is explained, but the current focus can be found in
system/view/focal-face. Here's a little example of the focus
rotating automatically through three fields...
rebol []
view layout [
backdrop rate 1 feel [
engage: func [face action event][
either all [
action = 'time
system/view/focal-face
object? f: system/view/focal-face/user-data
][
focus f
][
unfocus
]
]
]
f1: field
f2: field
f3: field
do [
f1/user-data: f2
f2/user-data: f3
f3/user-data: f1
]
]
To start the cycling, click on any field.
The feel (ie, event-handling) is added to the layout's backdrop. To
do the cycling it could've been added to any face since the cycling
is dependant on a timer, not a click on a specific face, but by using
the backdrop we can make it so a click on it will do an unfocus and
so end the cycling.
Hope this gets you started.
Oh yes, and welcome to the mailing-list and REBOL. Both are a lot of
fun as well as being very useful. ;-)
--
Carl Read