Bug in Tree widget 
Author Message
 Bug in Tree widget

Foreground option of 'Tree' widget is not working.

Try this program....

--------------------------------

#!/usr/bin/perl -w
use Tk;
use Tk::Tree;
        $top = MainWindow->new;
        $tree = $top->Tree(-foreground => 'red')->pack;
        $tree->add("Text1",-text => "Text1");
        $tree->add("Text2",-text => "Text2");
        $tree->add("Text3",-text => "Text3");
        MainLoop;

---------------------------------

Regards,
Kaladhaur P



Mon, 07 Nov 2005 19:23:01 GMT  
 Bug in Tree widget

Quote:
> Foreground option of 'Tree' widget is not working.

> Try this program....

> --------------------------------

> #!/usr/bin/perl -w
> use Tk;
> use Tk::Tree;
>         $top = MainWindow->new;
>         $tree = $top->Tree(-foreground => 'red')->pack;
>         $tree->add("Text1",-text => "Text1");
>         $tree->add("Text2",-text => "Text2");
>         $tree->add("Text3",-text => "Text3");
>         MainLoop;

This is not the way to display red text in your Tree widget. For complete
documentation, see Tk::DItem.pod, Tk::ItemStyle.pod and Tk::HList.pod
along with the 'widget' demo that comes with your Perl/Tk installation.

Here's a sneak peek:

        use Tk;
        use Tk::Tree;
        use Tk::ItemStyle;

        my $top = new MainWidow;
        my $tree = $top->Tree->pack;

        $tree->ItemStyle(qw/text -stylename redfg -fg red/);
        $tree->add('Text1');
        $tree->itemCreate(qw/Text1 0 -style redfg
                             -itemtype text -text Text1/);

        MainLoop;

--Ala



Tue, 08 Nov 2005 05:11:27 GMT  
 Bug in Tree widget

Quote:

> Foreground option of 'Tree' widget is not working.

> Try this program....

> --------------------------------

> #!/usr/bin/perl -w
> use Tk;
> use Tk::Tree;
>         $top = MainWindow->new;
>         $tree = $top->Tree(-foreground => 'red')->pack;
>         $tree->add("Text1",-text => "Text1");
>         $tree->add("Text2",-text => "Text2");
>         $tree->add("Text3",-text => "Text3");
>         MainLoop;

> ---------------------------------

Please apply the following patch

Index: Tixish/Tree.pm
===================================================================
--- Tixish/Tree.pm      (revision 62)

         -indent       => ['SELF', 'indent', 'Indent', 20],
         -width        => ['SELF', 'width', 'Width', 20],
         -itemtype     => ['SELF', 'itemtype', 'Itemtype', 'imagetext'],
+       -foreground   => ['SELF'],
        );
 }

or as a workaround call

     $tree->Tk::HList::configure(-foreground => "...")

instead.

Regards,
        Slaven

--

    babybike - routeplanner for cyclists in Berlin
               handheld (e.g. Compaq iPAQ with Linux) version of bbbike
    http://bbbike.sourceforge.net



Tue, 08 Nov 2005 03:45:18 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Bug in Tree widget?

2. Is there a Tree widget in perlTk that resembles the Tree widget in Tk

3. pTk 8.4.24 widget patch #1 - widget demo and friends bug fixes/modernizations

4. Hierarchical file-tree widgets anywhere?

5. prob. with tree widget

6. Tree Widget Trouble...

7. tree widget question

8. colors in Tree widget

9. Tree Widget actual size

10. Tree widget misbehaviour

11. Drawing pixels into a Tree/HList widget

12. tree view widget?

 

 
Powered by phpBB® Forum Software