diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-03-11 15:04:28 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-03-11 15:04:28 +0000 |
commit | 76bb7bf3df26d548691a946ec08cdc1dca8ceab2 (patch) | |
tree | 552720890b7e4c4acc7eba19313a92b1d67c7eb9 /perl-install/mygtk2.pm | |
parent | ffbff73124b5ff7d92283ba6a141131f9ff2b0d4 (diff) | |
download | drakx-76bb7bf3df26d548691a946ec08cdc1dca8ceab2.tar drakx-76bb7bf3df26d548691a946ec08cdc1dca8ceab2.tar.gz drakx-76bb7bf3df26d548691a946ec08cdc1dca8ceab2.tar.bz2 drakx-76bb7bf3df26d548691a946ec08cdc1dca8ceab2.tar.xz drakx-76bb7bf3df26d548691a946ec08cdc1dca8ceab2.zip |
allow to set sensitivity dynamically in mygtk2 with sensitive_ref
Diffstat (limited to 'perl-install/mygtk2.pm')
-rw-r--r-- | perl-install/mygtk2.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index 2cc4272d4..f78347977 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -131,6 +131,12 @@ sub _gtk { gtkval_register($w, $show_ref, sub { $$show_ref ? $w->show : $w->hide }); } + if (my $sensitive_ref = delete $opts->{sensitive_ref}) { + my $set = sub { $w->set_sensitive($$sensitive_ref) }; + gtkval_register($w, $sensitive_ref, $set); + $set->(); + } + if (%$opts && !$opts->{allow_unknown_options}) { internal_error("$action $class: unknown option(s) " . join(', ', keys %$opts)); } |