text formatting in a Text widget 
Author Message
 text formatting in a Text widget

Hi,

I just want to format my text in a simple text widget.

eg.
$var1 = "Firstname"
$var2 = "Lastname"

now I insert those variables to my widget:
$display->insert('end', "$var1 $var2");

this is performed a few times with different varibale contents (that
means the length of
the string in var1 is different)

i cannot get working it like a table; I mean I want that it looks like
below:

Thomas         Example1
Mike              Example21212
Herbert          Example12123

I want to write Example blablabla on a specific position. Do I have to
use tags?

Thx



Sun, 31 Jul 2005 17:35:40 GMT  
 text formatting in a Text widget

Quote:

> Hi,

> I just want to format my text in a simple text widget.

> eg.
> $var1 = "Firstname"
> $var2 = "Lastname"

> now I insert those variables to my widget:
> $display->insert('end', "$var1 $var2");

> this is performed a few times with different varibale contents (that
> means the length of
> the string in var1 is different)

> i cannot get working it like a table; I mean I want that it looks like
> below:

> Thomas         Example1
> Mike              Example21212
> Herbert          Example12123

> I want to write Example blablabla on a specific position. Do I have to
> use tags?

> Thx

Why don't you try this:

$textwidget->configure(-tabs => '2c');
$textwidget->insert('end', "$var1\t$var2");

Line number one puts a tabstop at every 2 centimeters.
Line number two is just like your code, just the space is replaced by a tab
character.

Best regards,

Hans



Mon, 08 Aug 2005 15:37:19 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Displaying text formats in a text widget...

2. Displaying text formats in a text widget...

3. Formatted Text or HTML Within Text Widget

4. inserting into text widget with Perl format

5. Q: Changing Text-Color in Text-Widget?

6. How update text in text widget when executing some other callback

7. Color Coding Text in a Tk::Text Widget

8. Checking for marked or selected text in a Text widget

9. Grabbing Text from Text widget

10. Retrieving a line of text from a Text Widget when clicking on it

11. Making text appear in a text widget...

12. best way to save text in Text widget

 

 
Powered by phpBB® Forum Software