[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

tk text tag_configure

Edward Redman

1/25/2007 2:02:00 AM

I am trying to use Ruby/tk and a TkText object and change the text font on
each line.

I can set the font and fontsize but when I do change the Tktext object.
All the text is changed. I believe I have to tag the text object in some
way but I am missing some point.

I am using a tcl file font.tcl as a model. There is a line in the tcl code
that I can't seem to get the ruby context.

..t tag configue f[incr count] -font [list $family 10]

if I have an object text = TkText.new could someone help me translate this
into ruby/tk.
I believe it is something like "text.tag_configure" but after this I am
lost.

thanks in advance
2 Answers

Joel VanderWerf

1/25/2007 4:12:00 AM

0

Ed Redman wrote:
> I am trying to use Ruby/tk and a TkText object and change the text font on
> each line.
>
> I can set the font and fontsize but when I do change the Tktext object.
> All the text is changed. I believe I have to tag the text object in some
> way but I am missing some point.
>
> I am using a tcl file font.tcl as a model. There is a line in the tcl code
> that I can't seem to get the ruby context.
>
> .t tag configue f[incr count] -font [list $family 10]
>
> if I have an object text = TkText.new could someone help me translate this
> into ruby/tk.
> I believe it is something like "text.tag_configure" but after this I am
> lost.
>
> thanks in advance

Take a look at sample/demos-en/style.rb. It creates a text box with
multiple fonts, faces, etc.

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Morton Goldberg

1/25/2007 6:40:00 AM

0

On Jan 24, 2007, at 11:12 PM, Joel VanderWerf wrote:

> Ed Redman wrote:
>> I am trying to use Ruby/tk and a TkText object and change the text
>> font on each line.
>> I can set the font and fontsize but when I do change the Tktext
>> object. All the text
>> is changed I believe I have to tag the text object in some way but
>> I am missing some
>> point.
>
> Take a look at sample/demos-en/style.rb. It creates a text box with
> multiple fonts, faces, etc.

Just to clarify things a little, the full URL is

http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/sam...
en/style.rb

Regards, Morton