[REBOL] Re: Question on text formatting
From: g:santilli:tiscalinet:it at: 30-Aug-2002 1:35
Hi Andy,
On Thursday, August 29, 2002, 11:52:16 PM, you wrote:
AF> Then the text is fixed to be "test". Every time I show, Rebol changes
AF> it back to the original text (which was test); Rebol must be storing
AF> the original text in some hidden place when I created the button, and
AF> always refreshing from that, rather than from the values stored I was
AF> expecting.
This is because the BUTTON style supports two texts, like in:
>> view layout [btn: button "Text 1" "Text 2"]
(You see the second text by clicking on the button)
They are in:
>> btn/texts
== ["Text 1" "Text 2"]
so you need to change that to make it work as you expect. If you
don't, you text is reset in the REDRAW feel:
redraw: func [face act pos /local state][
face/edge/effect: pick [ibevel bevel] face/state
if face/texts [face/text: face/texts/1]
all [face/state face/texts face/text: any [face/texts/2 face/texts/1]]
state: either not face/state [face/blinker] [true]
if face/colors [face/color: pick face/colors not state]
if face/effects [face/effect: pick face/effects not state]
]
AF> (this also seems to apply to colors).
Indeed, see above.
AF> So if I create a grid of blank buttons (or possibly uncolored buttons),
AF> I might be able to programatically change the appearance of the button
AF> to simulate non-mouse highlighting.
That's not needed, you just need to act on /texts and /colors.
Also, see my other message about /state to make a button look
pressed (this is in the REDRAW feel too).
HTH,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r