Subject: | addSingleChoicePage forgets choice when Back button used |
The addSingleChoicePage method sets the default choice when the Back
button is used, ignoring any other selection the user previously set.
This patch allows the user's choice to be remembered, or even
pre-selected via code by setting the -variable.
It also allows an invalid -variable to be set via code before the user
sees the page, making none of the choices set by default. A
-*NextButtonAction check can then ensure that the user consciously made
a selection.
===================================================================
--- Choices.pm (revision 73)
+++ Choices.pm (working copy)
@@ -280,8 +280,8 @@
-activebackground => $self->{background},
)->pack(qw/-side top -anchor w /);
- ${ $args->{-variable} } = $sValue if not $not_first_page++;
- ${ $args->{-variable} } = $sValue if $opt->{-selected};
+ ${ $args->{-variable} } ||= $sValue if not $not_first_page++;
+ ${ $args->{-variable} } ||= $sValue if $opt->{-selected};
my $s = $opt->{-subtitle} || '';
===================================================================