Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: tk listbox entry background color

by thundergnat (Deacon)
on Dec 12, 2007 at 18:56 UTC ( [id://656688]=note: print w/replies, xml ) Need Help??


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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://656688]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2024-03-29 01:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found