From 548ea2cdcdb1f3704b92a41663ed9baefb92089c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sat, 15 Jan 2005 13:37:40 +0000 Subject: fix using gtkset with text => ... on a Button --- perl-install/mygtk2.pm | 9 +++++---- 1 file 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') { -- cgit v1.2.1