/usr/share/doc/libgtk2-perl-doc/examples/attributes.pl is in libgtk2-perl-doc 2:1.2499-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #!/usr/bin/perl
use strict;
use warnings;
use Glib qw(TRUE FALSE);
use Gtk2 -init;
my $window = Gtk2::Window->new;
my $box = Gtk2::VBox->new;
my @labels = (
["Light, Oblique" => ['light', 'oblique']],
["Normal, Normal" => ['normal', 'normal']],
["Bold, Italic" => ['bold', 'italic']],
);
foreach (@labels) {
my ($string, $attrs) = @{$_};
my ($weight, $style) = @{$attrs};
my $list = Gtk2::Pango::AttrList->new;
$list->insert (
Gtk2::Pango::AttrWeight->new ($weight, 0, length $string));
$list->insert (
Gtk2::Pango::AttrStyle->new ($style, 0, length $string));
my $label = Gtk2::Label->new ($string);
$label->set_attributes ($list);
$box->add ($label);
}
$window->add ($box);
$window->show_all;
$window->signal_connect(delete_event => sub { Gtk2->main_quit; });
Gtk2->main;
|