diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-09-09 16:13:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-09-09 16:13:16 +0000 |
commit | bb4eb6bb98e98b33e83ba4ae934049a6f2cac4e0 (patch) | |
tree | 3e30a6715abc4926fe474dcd5940f81c11195f55 /perl-install/interactive.pm | |
parent | 7dd49ba305d4d26ca06904de3f39031596de571c (diff) | |
download | drakx-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.pm | 8 |
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'; |