1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
1 sub lister {
2 $f->destroy if Exists($f) ;
3 $f = $mw->Frame(-background => 'white')->pack ;
# LA LIGNE QUI MET LE BAZARD
4 $f->Label( -text => 'Liste')->pack ;
# Grid
$f->Label(-text => 'Nom')->grid(-row => 0, -column => 0 , -sticky => 'nesw') ;
$f->Label(-text => 'Prénom')->grid(-row => 0, -column => 1 , -sticky => 'nesw') ;
$f->Label(-text => 'Code postal')->grid(-row => 0, -column => 2 , -sticky => 'nesw') ;
my ($lig) = 1 ;
foreach my $ref (@pers) {
$f->Label(-text => $ref->[0])->grid(-row => $lig, -column => 0 , -sticky => 'nesw') ;
$f->Label(-text => $ref->[1])->grid(-row => $lig, -column => 1 , -sticky => 'nesw') ;
$f->Label(-text => $ref->[2])->grid(-row => $lig, -column => 2 , -sticky => 'nesw') ;
$lig++ ;
}
foreach my $label ($f->children) {
$label->configure( -background => 'white', -relief=>'solid', -borderwidth =>1, -padx=> 5, -anchor => 'w') ;
}
} |
Partager