From 518949ba7f1adfd8357870b0983fdb65059b0d40 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 31 Aug 2005 15:44:03 +0000 Subject: add ProgressBar --- perl-install/mygtk2.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index 5c79c5848..eaf63fc85 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -231,6 +231,24 @@ sub _gtk__HScale { $w; } +sub _gtk__ProgressBar { + my ($w, $opts) = @_; + + if (!$w) { + $w = Gtk2::ProgressBar->new; + } + + if (my $fraction_ref = delete $opts->{fraction_ref}) { + my $set = sub { $w->set_fraction($$fraction_ref) }; + gtkval_register($w, $fraction_ref, $set); + $set->(); + } elsif (exists $opts->{fraction}) { + $w->set_fraction(delete $opts->{fraction}); + } + + $w; +} + sub _gtk__VSeparator { &_gtk_any_simple } sub _gtk__HSeparator { &_gtk_any_simple } sub _gtk__Calendar { &_gtk_any_simple } -- cgit v1.2.1