in reply to Set background on Tk::Tree nodes
You should pass the bg option when you instantiate the tree, not when you add it to the main window.
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",-bg => 'red' ); $tree->add ( 1, -text => 'Some sample text', -itemtype => 'text', ); $tree->autosetmode; $tree->close (1); $tree->pack(-fill=>'both',-expand => 1); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Set background on Tk::Tree nodes
by GrandFather (Saint) on Jul 18, 2005 at 03:32 UTC |