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

[REBOL] Re: Question on text formatting

From: carl:cybercraft at: 30-Aug-2002 12:31

On 30-Aug-02, Andy Finkel wrote:
> Now, this is a _very_ interesting clue. > If I use a similar example, > view/new lay: layout [ button button button ] > lay/pane/1/text: "hithere" > show lay/pane/1 > wait none > The text on the button changes. In fact, I can change it to anything > I like, again and again. > But if I do something like: > view/new lay: layout [ button "test" button "test1" button "test" ] > lay/pane/1/text: "hithere" > show lay/pane/1 > wait none > Or > view/new lay: layout [ button copy "test" button copy "test1" button > copy "test" ] > lay/pane/1/text: "hithere" > show lay/pane/1 > wait none > Then the text is fixed to be "test". Every time I show, Rebol > changes it back to the original text (which was test); Rebol must be > storing the original text in some hidden place when I created the > button, and always refreshing from that, rather than from the values > stored I was expecting.
Hi Andy, There's a simple way around that. Your lay/pane/1/text: "hithere" creates a new reference to the new string, which is why it doesn't display, (layman talking here so take that description with a pinch of salt:), but if you just clear the current string and insert the new one it will be shown... view/new lay: layout [ button "test" button "test1" button "test" ] insert clear lay/pane/1/text "hithere" show lay/pane/1 wait none HTH.
> (this also seems to apply to colors). > So if I create a grid of blank buttons (or possibly uncolored > buttons), I might be able to programatically change the appearance > of the button to simulate non-mouse highlighting. > Andy
-- Carl Read