[REBOL] Re: draw has no access to the current face
From: anton:lexicon at: 30-Sep-2002 9:19
Here's another way:
view layout [
style button button
effect [draw [pen black fill-pen 0.0.0 circle 12x12 10]]
with [
append init [
effect/2/4: color
color: 120.120.150
]
]
button blue "blue"
button green "green"
]
It takes the fill-color from face/color, which is handier to write
at the end than:
with [user-data: blue]
but, as you can see, the button color behind the circle is
always going to be 120.120.150
Or perhaps a better way is to make your own little dialect,
using the words facet:
view layout [
style button button
effect [draw [pen black fill-pen 0.0.0 circle 12x12 10]]
with [
words: compose [
fill (func [new args][
new/effect/2/4: second args
next args
])
]
]
button blue fill red
button green fill black
]
(Mmm, on REBOL/View 1.2.1.3.1 21-Jun-2001, the second button's
circle looks more like a square to me... a bug in draw? All is ok
in the newer betas.)
Anton.