http://qs321.pair.com?node_id=656688


in reply to tk listbox entry background color

Sure, just set the (appropriately named) -background option to whatever you want.

#!/usr/bin/perl use warnings; use strict; use Tk; my $top = MainWindow->new; my @color = qw/red yellow pink green purple orange blue/; my $listbox = $top->Scrolled('Listbox')->pack; for (0..99){ $listbox->insert('end',$_); $listbox->itemconfigure($_, -background => $color[rand(@color)]); } MainLoop;