From: Richard Jones Date: Mon, 5 Apr 2010 20:25:34 +0000 (+0100) Subject: Add first slide / last slide menu options. X-Git-Tag: 1.0.0~5 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=f07f5d48f1872638e9ee0693abd51add87835782;p=techtalk-pse.git Add first slide / last slide menu options. --- diff --git a/techtalk-pse.pl b/techtalk-pse.pl index c5962e6..5d9369c 100755 --- a/techtalk-pse.pl +++ b/techtalk-pse.pl @@ -274,6 +274,8 @@ MAIN: while (1) { print STDERR "i = $i\n" if $verbose; $i-- if $go eq "PREV" && $i > 0; $i++ if $go eq "NEXT" && $i+1 < @files; + $i = 0 if $go eq "FIRST"; + $i = $#files if $go eq "LAST"; $current = $files[$i]; } } else { @@ -449,6 +451,20 @@ sub make_button_bar my $optsmenu = Gtk2::Menu->new (); + my $bfirst = Gtk2::MenuItem->new ("First slide"); + $bfirst->signal_connect (activate => sub { \&$cb ("FIRST") }); + $bfirst->show (); + $optsmenu->append ($bfirst); + + my $blast = Gtk2::MenuItem->new ("Last slide"); + $blast->signal_connect (activate => sub { \&$cb ("LAST") }); + $blast->show (); + $optsmenu->append ($blast); + + my $sep2 = Gtk2::SeparatorMenuItem->new (); + $sep2->show (); + $optsmenu->append ($sep2); + my $bquit = Gtk2::MenuItem->new ("Quit"); $bquit->signal_connect (activate => sub { \&$cb ("QUIT") }); $bquit->show ();