diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-01-15 13:37:40 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-01-15 13:37:40 +0000 |
commit | 548ea2cdcdb1f3704b92a41663ed9baefb92089c (patch) | |
tree | 687c8ab424acfefead3310ebf81ce4219902f6f5 /perl-install/mygtk2.pm | |
parent | 63f4f5a992731ab23a58890694177b2a55d0892e (diff) | |
download | drakx-548ea2cdcdb1f3704b92a41663ed9baefb92089c.tar drakx-548ea2cdcdb1f3704b92a41663ed9baefb92089c.tar.gz drakx-548ea2cdcdb1f3704b92a41663ed9baefb92089c.tar.bz2 drakx-548ea2cdcdb1f3704b92a41663ed9baefb92089c.tar.xz drakx-548ea2cdcdb1f3704b92a41663ed9baefb92089c.zip |
fix using gtkset with text => ... on a Button
Diffstat (limited to 'perl-install/mygtk2.pm')
-rw-r--r-- | perl-install/mygtk2.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index fd80472cc..3f6897899 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -128,11 +128,10 @@ sub _gtk__CheckButton { &_gtk_any_Button } sub _gtk_any_Button { my ($w, $opts, $class) = @_; - if (!$opts->{image}) { - add2hash_($opts, { mnemonic => 1 }); - } - if (!$w) { + if (!$opts->{image}) { + add2hash_($opts, { mnemonic => 1 }); + } $w = $opts->{image} ? "Gtk2::$class"->new : delete $opts->{mnemonic} ? "Gtk2::$class"->new_with_mnemonic(delete $opts->{text} || '') : "Gtk2::$class"->new_with_label(delete $opts->{text} || ''); @@ -153,6 +152,8 @@ sub _gtk_any_Button { }; gtkval_register($w, $text_ref, $set); $set->(); + } elsif (exists $opts->{text}) { + $w->set_label(delete $opts->{text}); } if ($class eq 'Button') { |