summaryrefslogtreecommitdiffstats
path: root/perl-install/my_gtk.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/my_gtk.pm')
-rw-r--r--perl-install/my_gtk.pm23
1 files changed, 12 insertions, 11 deletions
diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm
index 848a764a4..29de8a794 100644
--- a/perl-install/my_gtk.pm
+++ b/perl-install/my_gtk.pm
@@ -239,19 +239,20 @@ sub create_menu($@) {
$w
}
+sub add2notebook {
+ my ($n, $title, $book) = @_;
+
+ my ($w1, $w2) = map { new Gtk::Label($_) } $title, $title;
+ $book->{widget_title} = $w1;
+ $n->append_page_menu($book, $w1, $w2);
+ $book->show;
+ $w1->show;
+ $w2->show;
+}
+
sub create_notebook(@) {
my $n = new Gtk::Notebook;
- while (@_) {
- my $title = shift;
- my $book = shift;
-
- my ($w1, $w2) = map { new Gtk::Label($_) } $title, $title;
- $book->{widget_title} = $w1;
- $n->append_page_menu($book, $w1, $w2);
- $book->show;
- $w1->show;
- $w2->show;
- }
+ add2notebook($n, splice(@_, 0, 2)) while @_;
$n
}