[REBOL] Re: Newbie: Help with image buttons (View)
From: carl:cybercraft at: 27-Sep-2002 21:17
On 27-Sep-02, Matthew Kim wrote:
> Thanks for the great advice Carl!
> Now... On to my next problem... This is my first attemp using View
> and I'm pretty sure I'm not getting this done the best way possible.
> I seem to have pinpointed the problem to a 'foreach' loop.
> I have a function called:
> cellphone: layout [
> output: check "1" "test"
Note that layout's are objects, not functions. You can see this by
entering the following in the Console...
>> lo: layout [text "Hello"]
>> type? :lo
>> fun: func [a][print ["That was" a "!!!"]]
>> type? :fun
(The reason for the colons in front of the words when type? is used is
to prevent them being evaluated, as the function would be in the
View is also a function, as is layout...
>> type? :view
>> type? :layout
and so what happens with...
view layout [...]
is that layout turns the block into an object and then view parses the
object, displaying it as a window.
So I'm afraid it's back to the drawing board with the following
> Within this function, it calls another function:
> check: layout [number word][
> foreach ...
As 'layout used like that doesn't make sense in REBOL. 'func instead
of 'layout would, ('check would then be a function), but I'm not sure
what you're trying to do with it in the 'cellphone layout, so I think
you'll need to explain that a bit more for us to sort this out.