in reply to Re^2: Textview format, help please !
in thread Textview format, help please !

Maybe you've had a long day, but I gave Text::Table a try and got good results. Try this:
#!/usr/bin/perl use strict; use warnings; use Text::Table; my $tb = Text::Table->new( "ID", "DESCRIPTION", "QTY", "PRICE" ); $tb->load( [ "1 los", "LABOR ON PARTS", 1, '760.00' ], [ "2 sa", "STRIP", 1, '450.00' ], [ "3 av", "VALUE", 1, '2000.00' ], ); print $tb;

Replies are listed 'Best First'.
Re^4: Textview format, help please !
by peokai (Novice) on Jul 22, 2010 at 12:07 UTC
    That works, partially, the problem is it prints out the table as it should be in the cmd window, but the same text in the textview are scrambled :(

      peokai:

      I don't use Tk, Glade, Gtk, et. al., so this is just a wild guess. You've probably already considered this, but just on the chance that you didn't: Are you using a proportional font in our text window? A proportional font causes just the symptom you're describing because each letter may have a different width on the screen. Using a monospaced font (Courier, for instance) would fix the problem if that's the case.

      ...roboticus