AppWindow/Ext/StatusBar/SImageItem.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 37 CC 3 SCAR 17.5
CC
3
Cov
0%
Update
12.0
Populate
2.0
BEGIN
2.0
CRAP 5.8
1 package Tk::AppWindow::Ext::StatusBar::SImageItem;
2  
3 use strict;
4 use warnings;
5  
6 use Tk;
7 use base qw( Tk::AppWindow::Ext::StatusBar::STextItem);
8 Construct Tk::Widget 'SImageItem';
9  
10 sub Populate {
11 my ($self,$args) = @_;
12  
13 $self->SUPER::Populate($args);
14  
15 $self->ConfigSpecs(
16 -valueimages => ['PASSIVE', undef, undef, {}],
17 # DEFAULT => ['SELF'],
18 );
19 }
20  
21 sub Update {
22 my $self = shift;
23 my $value = $self->Callback(-updatecommand => $self);
24 my $imagehash = $self->cget('-valueimages');
25 my $image = $imagehash->{$value};
26 $image = 'error' unless defined $image;
27 unless (ref $image) {
28 $self->configure(-bitmap => $image);
29 } else {
30 $self->configure(-image => $image);
31 }
32 }
33  
34 1;