Justifying text with the -width option

Joel Hammer joel
Mon May 17 11:57:31 PDT 2004


I am having trouble getting text justified or anchored to the left when
a width parameter is used.

This snippet works fine except if a width option is added to the label
command, as is shown here. All the text is then centered in the label
box. Any insight appreciated.

Thanks,

Joel

set id [ open "|dir -1 " ]
set i 0
frame .a.b
while { [gets $id f ] >= 0} {
label .a.b.$i -text $f -width 30
                         ^
                      The Problem
pack .a.b.$i -anchor w
incr i }
pack .a.b


More information about the Linux-users mailing list