From ccae75643e0bad3a0450768463491b7760e8ad7c Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 8 May 2008 14:23:50 +0000 Subject: use Tk::NoteBook, looks better ;-) git-svn-id: svn://tug.org/texlive/trunk@7944 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl | 13 +------------ Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl | 13 +------------ Master/texmf/scripts/texlive/tlmgrgui/gui-install.pl | 14 +------------- Master/texmf/scripts/texlive/tlmgrgui/gui-remove.pl | 13 +------------ Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl | 14 +------------- Master/texmf/scripts/texlive/tlmgrgui/gui-update.pl | 13 +------------ Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl | 16 +++------------- 7 files changed, 9 insertions(+), 87 deletions(-) (limited to 'Master/texmf') diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl index ffcf06b28f6..d0ab708dbff 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl @@ -7,18 +7,7 @@ # -our $b4 = $top->Button(-text => "Architectures", - -command => sub { - foreach my $f (keys %screens) { - $screens{$f}->packForget - unless ($screens{$f} eq $back_arch); - } - $back_arch->pack; - }); - -$b4->pack(-side => 'left'); - -our $back_arch = $back->Frame; +our $back_arch = $back->add("arch",-label => "Architectures"); $screens{"arch"} = $back_arch; # this will be loaded only on unix systems! diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl index aec9606771d..3a20c3f5e98 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl @@ -6,18 +6,7 @@ # GUI for tlmgr # -our $b5 = $top->Button(-text => "Configuration", - -command => sub { - foreach my $f (keys %screens) { - $screens{$f}->packForget - unless ($screens{$f} eq $back_config); - } - $back_config->pack; - }); - -$b5->pack(-side => 'left'); - -our $back_config = $back->Frame; +our $back_config = $back->add("config",-label => "Configuration"); $screens{"config"} = $back_config; my $default_location = $localtlpdb->option_location; diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-install.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-install.pl index 64c6a954274..095221b8b46 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-install.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-install.pl @@ -7,19 +7,7 @@ # -our $b1 = $top->Button(-text => "Adding packages", - -command => sub { - foreach my $f (keys %screens) { - $screens{$f}->packForget - unless ($screens{$f} eq $back_f1); - } - $back_f1->pack; - }); - -$b1->pack(-side => 'left'); - - -our $back_f1 = $back->Frame; +our $back_f1 = $back->add("install",-label => "Installation"); $screens{"install"} = $back_f1; diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-remove.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-remove.pl index 9a2c8811080..210df50fa72 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-remove.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-remove.pl @@ -6,18 +6,7 @@ # GUI for tlmgr # -our $b2 = $top->Button(-text => "Removing packages", - -command => sub { - foreach my $f (keys %screens) { - $screens{$f}->packForget - unless ($screens{$f} eq $back_f2); - } - $back_f2->pack; - }); - -$b2->pack(-side => 'left'); - -our $back_f2 = $back->Frame; +our $back_f2 = $back->add("remove", -label => "Removing packages"); $screens{"remove"} = $back_f2; ####################### row 1 diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl index 70788fdc152..34e2e662833 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl @@ -6,19 +6,7 @@ # GUI for tlmgr # -our $b3 = $top->Button(-text => "Uninstallation", - -command => sub { - foreach my $f (keys %screens) { - $screens{$f}->packForget - unless ($screens{$f} eq $back_f3); - } - $back_f3->pack; - }); - -$b3->pack(-side => 'left'); - - -our $back_f3 = $back->Frame; +our $back_f3 = $back->add("uninstall", -label => "Uninstallation"); $screens{"uninstall"} = $back_f3; if ($^O=~/^MSWin(32|64)$/i) { diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-update.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-update.pl index 3c897f80b83..c541f50a26e 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-update.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-update.pl @@ -5,18 +5,7 @@ # GUI for tlmgr # -our $bu = $top->Button(-text => "Updating packages", - -command => sub { - foreach my $f (keys %screens) { - $screens{$f}->packForget - unless ($screens{$f} eq $back_up); - } - $back_up->pack; - }); - -$bu->pack(-side => 'left'); - -our $back_up = $back->Frame; +our $back_up = $back->add("update", -label => "Update"); $screens{"update"} = $back_up; ####################### row 1 diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl index 6d64a59813b..263c702ba42 100755 --- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl @@ -30,6 +30,7 @@ use TeXLive::TLUtils qw(setup_programs platform_desc win32); use Getopt::Long qw(:config no_autoabbrev require_order); use Tk; use Tk::Dialog; +use Tk::NoteBook; my $opt_location; my $opt_debug = 0; @@ -78,15 +79,13 @@ our $quit = $top->Button(-text => "Quit", $quit->pack(-side => 'right'); # frame .back -borderwidth 2 -our $back = $mw->Frame(-borderwidth => 2); +our $back = $mw->NoteBook(-borderwidth => 2, -dynamicgeometry => 1); # pack .top .back -side top -fill both -expand 1 $top->pack(-side => 'top', -fill => 'both', -expand => 1); $back->pack(-side => 'top', -fill => 'both', -expand => 1); -our %screens; - require("gui-install.pl"); require("gui-update.pl"); require("gui-remove.pl"); @@ -99,18 +98,9 @@ require("gui-config.pl"); my $packed = 0; if (defined($opt_screen)) { - foreach my $k (keys %screens) { - if ($opt_screen =~ m/^$k$/) { - $screens{$k}->pack; - $packed = 1; - } - } + $back->raise("$opt_screen"); } -if (!$packed) { - $screens{"install"}->pack; -} - Tk::MainLoop(); -- cgit v1.2.3