GrandFather has asked for the wisdom of the Perl Monks concerning the following question:
I'd like to set the background color of a Tk::Tree node to some shade of red and am having trouble doing it. My current code looks like this:
use warnings; use strict; use Tk; use Tk::Tree; my $main = MainWindow->new (-title => "Test tree"); my $tree = $main->ScrlTree ( -itemtype => 'text', -separator => '/', -scrollbars => "osoe" ); $tree->add ( 1, -text => 'Some sample text', -itemtype => 'text', -bg => 'red' ); $tree->autosetmode; $tree->close (1); $tree->pack(-fill=>'both',-expand => 1); MainLoop;
When run I get the error message unknown option "-bg" at C:/Perl/site/lib/Tk.pm line 247.
Where am I going wrong?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Set background on Tk::Tree nodes
by pg (Canon) on Jul 18, 2005 at 03:12 UTC | |
by GrandFather (Saint) on Jul 18, 2005 at 03:30 UTC | |
by pg (Canon) on Jul 18, 2005 at 03:53 UTC | |
by GrandFather (Saint) on Jul 18, 2005 at 04:06 UTC | |
|
Re: Set background on Tk::Tree nodes
by BrowserUk (Patriarch) on Jul 18, 2005 at 03:25 UTC | |
by GrandFather (Saint) on Jul 18, 2005 at 03:32 UTC |