diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-08-31 15:44:03 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-08-31 15:44:03 +0000 |
commit | 518949ba7f1adfd8357870b0983fdb65059b0d40 (patch) | |
tree | 5c7accb0d0aaa179aeb33c2ec49fbf6ca8dbc8b1 /perl-install/mygtk2.pm | |
parent | 9c3f2927cd33c5a905397d0caf9e4287c52f1359 (diff) | |
download | drakx-backup-do-not-use-518949ba7f1adfd8357870b0983fdb65059b0d40.tar drakx-backup-do-not-use-518949ba7f1adfd8357870b0983fdb65059b0d40.tar.gz drakx-backup-do-not-use-518949ba7f1adfd8357870b0983fdb65059b0d40.tar.bz2 drakx-backup-do-not-use-518949ba7f1adfd8357870b0983fdb65059b0d40.tar.xz drakx-backup-do-not-use-518949ba7f1adfd8357870b0983fdb65059b0d40.zip |
add ProgressBar
Diffstat (limited to 'perl-install/mygtk2.pm')
-rw-r--r-- | perl-install/mygtk2.pm | 18 |
1 files changed, 18 insertions, 0 deletions
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 } |