Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I'm really having trouble with PERL/TK and colorization of data. (Haven't got an answer to my previous question yet on Colorization and Tree/Hlist. The colorization works but looks ugly since the lengths for selected and unselected data are different.) What I'd like to do is something like this and eventually use TiedListbox:
#!/usr/local2/bin/perl -w use Tk; $t=new MainWindow; $l=$t->Listbox(); $l->insert('end','make this red'); $l->insert('end','make this blue'); $l->insert('end','make this green'); $l->pack; $t->Button(-text => 'exit',-command => sub {exit;})->pack; MainLoop;
This fails though. The best I could come up with was ditch the Tk:Listbox and use a Tk:Text instead...
#!/usr/local/bin/perl -w use Tk; $t=new MainWindow; $l=$t->Text; $l->insert('end',"make this red\n", 'red'); $l->insert('end',"make this blue\n", 'blue'); $l->insert('end',"make this green\n", 'tagForGreen'); $l->pack; $l->tag(configure => 'red', -foreground => 'red'); $l->tag(configure => 'blue', -foreground => 'blue'); $l->tag(configure => 'tagForGreen', -foreground => 'green'); $t->Button(-text => 'exit',-command => sub {exit;})->pack; MainLoop;
This is not exactly idea for dealing with matrix data. I'm getting a little soured on Perl::TK and its lack of data control in HLIST/TREE and LISTBOX/TIEDLISTBOX. Are there any other graphical packages with PERL that are more flexible? Thanks, Daniel L. Needles

Replies are listed 'Best First'.
Re: Colorize Listbox data rows or hlist data rows
by the_slycer (Chaplain) on Mar 16, 2001 at 00:59 UTC
    Well, judging by your prior posts you are using windows 2000, so you might want to look into Win32::GUI. I don't know for sure whether this will do what you want or not, but it's probably worth looking into.