[REBOL] Re: button vs box changes
From: carl:cybercraft at: 23-Dec-2001 10:18
On 23-Dec-01, Richard Boyd wrote:
> Why does [test-box] below show text and color changes made to a
> "box" .... but [test-button] does NOT show changes made to a
> "button"?
> I do not understand how the two differ.
It's because the default button colors (in and out) are an effect
gradient and so get their colors from /effects, not /color. The
following shows how to change them...
view layout [
b: button "Test Button"
button "Printout" [
print "Effects:" probe b/effects
]
button "Change" [
b/effects/1/3: random 255.255.255
b/effects/1/4: random 255.255.255
b/effects/2/3: random 255.255.255
b/effects/2/4: random 255.255.255
show b
]
]
> Thanx in advance.
> -richard-
> ;-----------------------------
> test-box: func
> []
> [lay: layout
> [bx: box 100x24 black
> button "Red Box" [bx/color: red show bx]
> button "Text Box" [bx/text: "not ok" show bx]
> button "Print Box" [print join bx/text [" "bx/color]]]
> view center-face lay]
> ;-----------------------------
> test-button: func
> []
> [lay: layout
> [b: button "OK"
> button "Red Button" [b/color: red show b]
> button "Text Button" [b/text: "not ok" show b]
> button "Print Button" [print join b/text [" "b/color]]]
> view center-face lay]
--
Carl Read