You are right, it should work. However with me it is not working and I guess this is a bug or something else in the listbox module of Tk. Below you can find an example using your example were it comes out bad in the listbox.

#!/usr/bin/perl -w use strict; use warnings; use Tk; $|++; my $W; my $c; my $lab; my @newtext; use Text::Tabs; my $tabstop = 8; my $text = "Shape:r59\tX-loc:9.77\tY-loc:5.608"; my $text1 = "Shape:r59\tX-loc:9.8819\tY-loc:0"; push @newtext,($text,$text1); my @newtext = expand(@newtext); $c = initCanvas4(); sub initCanvas4 { $W = MainWindow->new; $W->title("Fiducial Information"); $W->iconname('Fiducial Information'); my $canv = $W->Canvas(qw/-relief sunken -relief flat -bd 0 -width 512 +-height 350 -background SlateGray3/); $canv->pack; return $canv; } # Create a listbox with the contents of the directory. + my $ent = $c->Scrolled(qw/Listbox -setgrid 1 -height 3 -width 40 -scro +llbars e -selectmode single/); for(@{newtext}) { $ent->insert(0, "$_"); } #$ent->bind('<Double-Button-1>', # sub { # $file_selected = $ent->get('active'); # # } $c->createWindow('10p 80p', -window => $lab, -anchor => 'nw' ); $c->createWindow('10p 95p', -window => $ent, -anchor => 'nw' ); MainLoop;

In reply to Re: Re^3: How to replace Tab with spaces not altering postion by juo
in thread How to replace Tab with spaces not altering postion by juo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.