From f07f5d48f1872638e9ee0693abd51add87835782 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 5 Apr 2010 21:25:34 +0100 Subject: [PATCH] Add first slide / last slide menu options. --- techtalk-pse.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 (); -- 1.8.3.1