O'Reilly logo

Mastering Perl/Tk by Nancy Walsh, Stephen Lidie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tix Images

There are some additional images that are part of the Tix package: act_fold, file folder, info, minus, minusarm, no_entry, openfold, plus, plusarm, srcfile, textfile, and warning. You can use them just like any other images (See Chapter 17 for more details). They are shown in Figure 18-9.

Tix images shown as imagetext items in a TList

Figure 18-9. Tix images shown as imagetext items in a TList

Here’s the code that created Figure 18-9:

use Tk;
require Tk::TList;

my $mw = Tk::MainWindow->new(-title => 'Tix Images');
my $tlist = $mw->TList->pack(-expand => 1, -fill => 'both');

foreach (qw/act_fold file folder info minus 
            minusarm no_entry openfold plus 
            plusarm srcfile textfile warning/) {
  $tlist->insert('end', -itemtype => 'imagetext', -text => $_, 
            -image => $mw->Getimage($_));
}

MainLoop;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required