Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

button vs box changes

 [1/3] from: richard-boyd::worldnet::att::net at: 22-Dec-2001 11:50


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. 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]

 [2/3] from: sunandadh:aol at: 22-Dec-2001 15:34


Hi Richard,
> 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"?
Buttons are two-tone, so the effect gradient overrides the color setting. This will change the colour of a standard button: test-button: func [] [lay: layout [b: button "OK" button "Red Button" [b/effect/3: Red b/effect/4: pink show b] button "Text Button" [b/text: "not ok" show b] button "Print Button" [print join b/text [" " mold b/effect]]] view center-face lay] You could have set the color in the expected manner if you'd given the button a straight color in the first place: test-button: func [] [lay: layout [b: button "OK" Blue button "Red Button" [b/color: Red show b] button "Text Button" [b/text: "not ok" show b] button "Print Button" [print join b/text [" " mold b/effect]]] view center-face lay] To change the text on a button, use the TEXTS field. Inconsistent, I reckon, but fits with things line rotary and choice fields which use this for more the one displayable text in a button. test-button: func [] [lay: layout [b: button "OK" button "Red Button" [b/effect/3: Red b/effect/4: pink show b] button "Text Button" [b/textS: "not ok" show b] button "Print Button" [print join b/textS [" " mold b/effect]]] view center-face lay] Sunanda.

 [3/3] 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-
<<quoted lines omitted: 16>>
> button "Print Button" [print join b/text [" "b/color]]] > view center-face lay]
-- Carl Read

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted