Subject: | -preNextButtonAction and -postNextButtonAction are reversed |
(correct my understanding if I am wrong) preNextButtonAction is called
before Next button is pressed, while postNextButtonAction is called
after Next button is pressed. But I find the result is reversed. Here is
an eg program running with Tk:Wizard 1.943 and perl 5.8.5-16 on RHEL4.
[Expected result]
post 1
pre 2
post 2
pre 3
[Real result]
pre 1
post 2
pre 2
post 3
pre 3
[Program]
use Tk::Wizard;
my $wizard = new Tk::Wizard();
$wizard->configure(
-preNextButtonAction => sub { &preNextButtonAction($wizard) },
-postNextButtonAction => sub { &postNextButtonAction($wizard) },
);
$wizard->addPage( sub{
$wizard->blank_frame(
-title => "page 1",
);}
);
$wizard->addPage( sub{
$wizard->blank_frame(
-title => "page 2",
);}
);
$wizard->addPage( sub{
$wizard->blank_frame(
-title => "page 3",
);}
);
$wizard->Show;
MainLoop;
sub postNextButtonAction { my $wizard = shift;
$_ = $wizard->currentPage;
print "post $_\n";
return 1;
}
sub preNextButtonAction { my $wizard = shift;
$_ = $wizard->currentPage;
print "pre $_\n";
return 1;
}