summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-09 16:13:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-09 16:13:16 +0000
commitbb4eb6bb98e98b33e83ba4ae934049a6f2cac4e0 (patch)
tree3e30a6715abc4926fe474dcd5940f81c11195f55 /perl-install/interactive.pm
parent7dd49ba305d4d26ca06904de3f39031596de571c (diff)
downloaddrakx-bb4eb6bb98e98b33e83ba4ae934049a6f2cac4e0.tar
drakx-bb4eb6bb98e98b33e83ba4ae934049a6f2cac4e0.tar.gz
drakx-bb4eb6bb98e98b33e83ba4ae934049a6f2cac4e0.tar.bz2
drakx-bb4eb6bb98e98b33e83ba4ae934049a6f2cac4e0.tar.xz
drakx-bb4eb6bb98e98b33e83ba4ae934049a6f2cac4e0.zip
clicked_may_quit used in place of clicked+exception to work-around perl-GTK bug (?)
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r--perl-install/interactive.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index bd8d4ed7a..b6c93b8e7 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -18,7 +18,9 @@ use common;
#- disabled => function returning wether it should be disabled (grayed)
#- gtk => gtk preferences
#- type =>
-#- button => (with clicked) (type defaults to button if clicked is there) (val need not be a reference)
+#- button => (with clicked or clicked_may_quit)
+#- (type defaults to button if clicked or clicked_may_quit is there)
+#- (val need not be a reference) (if clicked_may_quit return true, it's as if "Ok" was pressed)
#- label => (val need not be a reference) (type defaults to label if val is not a reference)
#- bool (with text)
#- range (with min, max)
@@ -253,9 +255,9 @@ sub ask_from_normalize {
} elsif ($e->{type} eq 'range') {
$e->{min} <= $e->{max} or die "bad range min $e->{min} > max $e->{max} (called from " . join(':', caller()) . ")";
${$e->{val}} = max($e->{min}, min(${$e->{val}}, $e->{max}));
- } elsif ($e->{type} eq 'button' || $e->{clicked}) {
+ } elsif ($e->{type} eq 'button' || $e->{clicked} || $e->{clicked_may_quit}) {
$e->{type} = 'button';
- $e->{clicked} ||= sub {};
+ $e->{clicked_may_quit} ||= $e->{clicked} ? sub { $e->{clicked}(); 0 } : sub {};
$e->{val} = \ (my $v = $e->{val}) if !ref($e->{val});
} elsif ($e->{type} eq 'label' || !ref($e->{val})) {
$e->{type} = 'label';