Subject: | -.*ButtonAction args not passed to add.*Page methods |
When calling any /add.*Page/ method (e.g. addMultipleChoicePage) all the
arguments are passed on to the private page-creation subroutine (e.g.
_page_multiple_choice).
The /-.*ButtonAction/ arguments (e.g. -preNextButtonAction) arguments
need to be passed instead to the addPage subroutine.
The following patch is a suggested fix, currently in use by me:
=======================================================================
diff -cr Tk-Wizard-2.149/lib/Tk/Wizard/Choices.pm
tk-wizard-fix/lib/Tk/Wizard/Choices.pm
*** Tk-Wizard-2.149/lib/Tk/Wizard/Choices.pm Mon Jan 14 12:45:10 2008
--- tk-wizard-fix/lib/Tk/Wizard/Choices.pm Thu Feb 11 10:39:04 2010
***************
*** 93,99 ****
sub Tk::Wizard::addMultipleChoicePage {
my $self = shift;
my $args = {@_};
! return $self->addPage( sub { $self->_page_multiple_choice($args) } );
}
--- 93,103 ----
sub Tk::Wizard::addMultipleChoicePage {
my $self = shift;
my $args = {@_};
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! return $self->addPage( sub { $self->_page_multiple_choice($args)
}, %btn_args );
}
***************
*** 228,234 ****
my $args = {@_};
# print STDERR " DDD addSingleChoicePage args are ", Dumper($args);
! return $self->addPage( sub { $self->_page_single_choice($args) } );
}
sub Tk::Wizard::_page_single_choice {
--- 232,242 ----
my $args = {@_};
# print STDERR " DDD addSingleChoicePage args are ", Dumper($args);
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! return $self->addPage( sub { $self->_page_single_choice($args) },
%btn_args );
}
sub Tk::Wizard::_page_single_choice {
diff -cr Tk-Wizard-2.149/lib/Tk/Wizard/FileSystem.pm
tk-wizard-fix/lib/Tk/Wizard/FileSystem.pm
*** Tk-Wizard-2.149/lib/Tk/Wizard/FileSystem.pm Wed Apr 2 02:51:12 2008
--- tk-wizard-fix/lib/Tk/Wizard/FileSystem.pm Thu Feb 11 10:39:14 2010
***************
*** 65,71 ****
sub Tk::Wizard::addDirSelectPage {
my $self = shift;
my $args = {@_};
! $self->addPage( sub { $self->_page_dirSelect($args) } );
}
--- 65,75 ----
sub Tk::Wizard::addDirSelectPage {
my $self = shift;
my $args = {@_};
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! $self->addPage( sub { $self->_page_dirSelect($args) }, %btn_args );
}
***************
*** 381,387 ****
sub Tk::Wizard::addFileSelectPage {
my $self = shift;
my $args = {@_};
! $self->addPage( sub { $self->_page_fileSelect($args) } );
}
#
--- 385,395 ----
sub Tk::Wizard::addFileSelectPage {
my $self = shift;
my $args = {@_};
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! $self->addPage( sub { $self->_page_fileSelect($args) }, %btn_args );
}
#
diff -cr Tk-Wizard-2.149/lib/Tk/Wizard/Installer/Win32.pm
tk-wizard-fix/lib/Tk/Wizard/Installer/Win32.pm
*** Tk-Wizard-2.149/lib/Tk/Wizard/Installer/Win32.pm Fri Jan 2
15:46:43 2009
--- tk-wizard-fix/lib/Tk/Wizard/Installer/Win32.pm Thu Feb 11
10:40:47 2010
***************
*** 297,303 ****
sub addStartMenuPage {
my ( $self, $args ) = ( shift, {@_} );
! return $self->addPage( sub { $self->_page_start_menu($args) } );
}
sub _page_start_menu {
--- 297,307 ----
sub addStartMenuPage {
my ( $self, $args ) = ( shift, {@_} );
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! return $self->addPage( sub { $self->_page_start_menu($args) },
%btn_args );
}
sub _page_start_menu {
diff -cr Tk-Wizard-2.149/lib/Tk/Wizard/Installer.pm
tk-wizard-fix/lib/Tk/Wizard/Installer.pm
*** Tk-Wizard-2.149/lib/Tk/Wizard/Installer.pm Wed Dec 31 12:19:47 2008
--- tk-wizard-fix/lib/Tk/Wizard/Installer.pm Thu Feb 11 10:40:23 2010
***************
*** 144,150 ****
my ( $self, $args ) = ( shift, {@_} );
DEBUG_FUNC && print STDERR " FFF addLicencePage\n";
Carp::croak "No -filepath argument present" if not $args->{-filepath};
! $self->addPage( sub { $self->_page_licence_agreement($args) } );
}
--- 144,154 ----
my ( $self, $args ) = ( shift, {@_} );
DEBUG_FUNC && print STDERR " FFF addLicencePage\n";
Carp::croak "No -filepath argument present" if not $args->{-filepath};
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! $self->addPage( sub { $self->_page_licence_agreement($args) },
%btn_args );
}
***************
*** 374,380 ****
#
sub addFileListPage {
my ( $self, $args ) = ( shift, {@_} );
! $self->addPage( sub { $self->_page_filelist($args) } );
}
=head2 addFileCopyPage
--- 378,388 ----
#
sub addFileListPage {
my ( $self, $args ) = ( shift, {@_} );
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! $self->addPage( sub { $self->_page_filelist($args) }, %btn_args );
}
=head2 addFileCopyPage
***************
*** 740,746 ****
sub addDownloadPage {
my ( $self, $args ) = ( shift, {@_} );
DEBUG_FUNC && print STDERR " FFF addDownloadPage\n";
! $self->addPage( sub { $self->_page_download($args) } );
} # addDownloadPage
sub _page_download {
--- 748,758 ----
sub addDownloadPage {
my ( $self, $args ) = ( shift, {@_} );
DEBUG_FUNC && print STDERR " FFF addDownloadPage\n";
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! $self->addPage( sub { $self->_page_download($args) }, %btn_args );
} # addDownloadPage
sub _page_download {
***************
*** 1102,1108 ****
sub addUninstallPage {
my ( $self, $args ) = ( shift, {@_} );
! $self->addPage( sub { $self->_page_uninstall($args) } );
}
sub _page_uninstall {
--- 1114,1124 ----
sub addUninstallPage {
my ( $self, $args ) = ( shift, {@_} );
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! $self->addPage( sub { $self->_page_uninstall($args) }, %btn_args );
}
sub _page_uninstall {
diff -cr Tk-Wizard-2.149/lib/Tk/Wizard/Tasks.pm
tk-wizard-fix/lib/Tk/Wizard/Tasks.pm
*** Tk-Wizard-2.149/lib/Tk/Wizard/Tasks.pm Wed Dec 31 11:43:22 2008
--- tk-wizard-fix/lib/Tk/Wizard/Tasks.pm Thu Feb 11 10:40:36 2010
***************
*** 111,117 ****
my $self = shift;
my $args = {@_};
! $self->addPage( sub { $self->_page_taskList($args) } );
}
sub Tk::Wizard::_page_taskList {
--- 111,121 ----
my $self = shift;
my $args = {@_};
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! $self->addPage( sub { $self->_page_taskList($args) }, %btn_args );
}
sub Tk::Wizard::_page_taskList {
diff -cr Tk-Wizard-2.149/lib/Tk/Wizard.pm tk-wizard-fix/lib/Tk/Wizard.pm
*** Tk-Wizard-2.149/lib/Tk/Wizard.pm Wed Dec 31 13:38:41 2008
--- tk-wizard-fix/lib/Tk/Wizard.pm Thu Feb 11 10:38:51 2010
***************
*** 1332,1338 ****
sub addSplashPage {
TRACE "Enter addSplashPage";
my ($self, $args) = (shift, {@_});
! return $self->addPage( sub { $self->blank_frame(%$args) } );
}
=head2 addTextFramePage
--- 1332,1342 ----
sub addSplashPage {
TRACE "Enter addSplashPage";
my ($self, $args) = (shift, {@_});
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! return $self->addPage( sub { $self->blank_frame(%$args) },
%btn_args );
}
=head2 addTextFramePage
***************
*** 1349,1355 ****
sub addTextFramePage {
my ($self, $args) = (shift, {@_});
DEBUG "addTextFramePage args are ", Dumper($args);
! return $self->addPage( sub { $self->_text_frame($args) } );
}
sub _text_frame {
--- 1353,1363 ----
sub addTextFramePage {
my ($self, $args) = (shift, {@_});
DEBUG "addTextFramePage args are ", Dumper($args);
! my %btn_args =
! map { my $x = delete $args->{$_}; $_ => $x }
! grep { /ButtonAction$/ }
! keys %$args;
! return $self->addPage( sub { $self->_text_frame($args) }, %btn_args );
}
sub _text_frame {
=======================================================================