App-CPAN2Pkg
view release on metacpan or search on metacpan
lib/App/CPAN2Pkg/UI/Tk.pm view on Meta::CPAN
$hlist->header( create => 1, -text => 'bs' );
$hlist->header( create => 2, -text => 'module' );
$hlist->bind( '<Double-1>', $self->_session->postback('_on_hlist_2click') );
}
#
# $main->_build_notebook( $parent );
#
# build the notebook holding one pane per module being built. first tab
# contains the legend.
#
sub _build_notebook {
my ($self, $parent) = @_;
# create the notebook that will hold module details
my $nb = $parent->NoteBook->pack( top, xfill2 );
$self->_set_w('notebook', $nb);
# create a first tab with the legend
my $legend = $nb->add("Legend", -label=>"Legend");
#my $legend = $mw->Frame->pack( top, fillx );
my @lab1 = ( 'not started', 'not available', 'building', 'installing', 'available', 'error' );
my @col1 = qw{ black yellow orange blue green red };
my @lab2 = ( 'not started', 'not available', 'importing', 'building', 'available', 'error' );
my @col2 = qw{ black yellow purple orange green red };
$legend->Label( -text => 'Local' )
->grid( -row => 0, -column => 0, -columnspan=>2, -sticky => 'w' );
$legend->Label( -text => 'Build System' )
->grid( -row => 0, -column => 2, -columnspan=>2,-sticky => 'w' );
my $buldir = $SHAREDIR->subdir( 'bullets' );
foreach my $i ( 0 .. $#lab1 ) {
$legend->Label( -image => _image( $buldir->file( $col1[$i] . ".png" ) ) )
->grid( -row => $i + 1, -column => 0, ipad5 );
$legend->Label( -image => _image( $buldir->file( $col2[$i] . ".png" ) ) )
->grid( -row => $i + 1, -column => 2, ipad5 );
$legend->Label( -text => $lab1[$i] )->grid( -row=>$i+1, -column=>1, -sticky => 'w' );
$legend->Label( -text => $lab2[$i] )->grid( -row=>$i+1, -column=>3, -sticky => 'w' );
}
}
# -- private subs
#
# my $img = _image( $path );
#
( run in 1.177 second using v1.01-cache-2.11-cpan-49f99fa48dc )