Beginner's question about VID and layouts
[1/3] from: rebolmikko::yahoo::com at: 26-Nov-2001 17:52
It seems to take hours of trying for me to get this
right, so could someone please help?
Why doesn't this work?:
-----------------------------
stuff: layout [
text yellow "stuff"
]
func1: [
print "func1"
]
view/new layout [
the-box: box 400x400 black feel [
engage: func [face action event] [
;print event/key
if event/key = 'a [view stuff]
if event/key = 'b [do func1]
]
]
]
focus the-box
do-events
---------------
So I want to just some way to view text, when specific
key is pressed - either in existing layout or another,
doesn't matter...
Every time I try to do basic stuff like this I seem to
run into problems. It is a bit difficult (at least for
me) to understand what is possible to do and what is
not, given the (lack of) current documentation...
Cheers,
Mikko
[2/3] from: rebolmikko::yahoo::com at: 26-Nov-2001 18:26
Found the error
I found the error: "if event/key = 'a " doesn't work.
I thought I already tried it, but I was using 'down ,
which works. How are the ordinary keys handled?
Cheers,
Mikko
[3/3] from: ljurado:bariloche:ar at: 27-Nov-2001 0:28
>> type? 'a
== word!
>> type? #"a"
== char!
if event/key = #"a" works fine.
Luis