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;

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

Replies are listed 'Best First'.
Re^2: Set background on Tk::Tree nodes
by GrandFather (Saint) on Jul 18, 2005 at 03:32 UTC

    I'm interested in highlighting items in the tree, not the whole thing.

    Thanks anyway.


    Perl is Huffman encoded by design.