PodViewer Problem



When running the attached program, I get the following error:

Use of uninitialized value in subroutine entry at PodViewer.pm line 312.

If I comment out the "$viewer->jump_to($mark);" line, the error goes away.

What have I got wrong?

Jeff

#!/usr/bin/perl -w

use strict;
use Gtk2 -init;
use Gtk2::Ex::PodViewer;
use Gtk2::Ex::Simple::List;

my $window = Gtk2::Window -> new;
$window -> signal_connect ( 'delete_event', sub { Gtk2 -> main_quit; } );

my $index = Gtk2::Ex::Simple::List->new('title' => 'text');
my $index_scrwin = Gtk2::ScrolledWindow->new;
$index_scrwin->set_policy('automatic', 'automatic');
$window -> add($index_scrwin);
$index_scrwin->add_with_viewport($index);

my $viewer = Gtk2::Ex::PodViewer->new;

$viewer -> load($0);

map { push(@{$index->{data}}, [ $_ ]) } $viewer->get_marks;

$index->get_selection->signal_connect('changed', sub {
 my $idx = ($index->get_selected_indices)[0];
 my $mark = $index->{data}[$idx][0];
 $viewer->jump_to($mark);
 return 1;
});

$window -> show_all;
Gtk2 -> main;

__END__

=head1 Name

=head1 Synopsis

=head1 Description

=head1 See Also

=head1 Author



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]