Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This fails though. The best I could come up with was ditch the Tk:Listbox and use a Tk:Text instead...#!/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 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#!/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;
|
|---|
| 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 |