Subject: | addTaskListPage: -*_photo options only work with filenames |
Attempting to supply scalar ref Tk::Photo data to -todo_photo etc.
fails. Option value is assumed to be a filename, not a data ref.
Patch:
===================================================================
--- Tasks.pm (revision 2.149)
+++ Tasks.pm (working copy)
@@ -129,9 +129,15 @@
if ( !$args->{$sArg} ) {
$photos->{$state} = $self->Photo( $state, -data =>
$Tk::Wizard::Image::TASK_LIST{$state} );
}
- elsif (!-r $args->{$sArg}
- || !$self->Photo( $state, -file => $args->{$sArg} ) )
- {
+ elsif ( ref($args->{$sArg}) eq 'SCALAR' ) {
+ $photos->{$state} = $self->Photo( $state, -data =>
${$args->{$sArg}} ) ||
+ warn "# Could not read $sArg from referenced data " .
${$args->{$sArg}};
+ }
+ elsif (-r $args->{$sArg}) {
+ $photos->{$state} = $self->Photo( $state, -file =>
$args->{$sArg} ) ||
+ warn "# Could not read $sArg from file " . $args->{$sArg};
+ }
+ else {
warn "# Could not read $sArg from " . $args->{$sArg};
}
}
@@ -228,7 +234,7 @@
if ( Tk::Exists( $self->{nextButton} ) ) {
$self->{nextButton}->configure( -state => "normal" );
- # $self->{nextButton}->invoke if $args->{ -continue };
+ $self->{nextButton}->invoke if $args->{ -continue };
}
}, # End of anonymous sub
===================================================================