Same idea as effect and effects,
so text and texts. You need to update
both the current TEXT and the TEXTS
facets....

Try these, and click the button:

        view layout [b: button "text" [probe b/texts]]
        ;== ["text"]

        view layout [b: button "text" "alt text" [probe b/texts]]
        ;== ["text" "alt text"]

        same? b/text b/texts/1 ;== true
        

To see how it all works, you must look at the
feel of the button style.

        probe b/feel

You can see what happens when you click.
Read carefully, you will see EFFECT and EFFECTS,
TEXT and TEXTS, and COLOR & COLORS mentioned.

It's also useful to see what facets are in a face
object:

        print mold first b

and to see what value one of them has:

        b/style ;== button

also check the init code of the face:

        print mold b/init

Anton.

> 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.
> 
> (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
> 
>  
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf
> Of Anton
> Sent: Thursday, August 29, 2002 2:28 PM
> To: [EMAIL PROTECTED]
> Subject: [REBOL] Re: Question on text formatting
> 
> 
> A while back, when View was upgraded,
> the button style became more complicated,
> using a gradient effect.
> Anyhow, here's an example of how to change
> the first button in a face containing three
> buttons.
> 
>       view/new center-face lay: layout [
>               button button button
>       ]
>       ; modify first button
>       lay/pane/1/effects: [
>               [gradient 0x1 166.120.192 0.0.200] ; normal
>               [gradient 0x-1 66.120.192 44.80.132] ; pressed
>       ]
>       lay/pane/1/effect: first lay/pane/1/effects
>       show lay/pane/1
>       wait none ; wait for events
> 
> see also
> 
>       print mold lay/pane/1/feel
> 
> Anton.
> 
> > Thanks for your help so far!
> > 
> > 
> > << and if anyone knows of an easy way to force one of the
> > buttons on the scrolling grid to be "selected" my day would be
> complete
> > :-) >>
> > 
> > >FOCUS is what you use to select a specific face. I'm not sure it will
> > do
> > >what you want here though. Buttons don't respond to many keystroke by
> > >default (you can, of course, add that behavior). I think Brett
> Handley
> > did a
> > >grid style that let you move from face to face with the keyboard.
> Maybe
> > it
> > >was Cyphre. So many talented people write great stuff that I lose
> > track. :)
> > 
> > >   view layout [a: button [print "A"] b: button [focus a]]
> > 
> > 
> > What I am after is a way to programatically make one of the buttons in
> > the grid appear to be selected.  I don't have a mouse for this
> > application;  everything is done via a keypad.
> > 
> > I was wondering if there were any tricks I could be using to get that
> > effect.
> > 
> > (like, is there a way I could iterate through the list of buttons
> > associated with a particular face, and somehow change that buttons
> color
> > ?)
> > 
> > Thanks,
> > 
> > 
> > Andy

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to