# Set up frames to contain all the pids (for selection) my $frame_pids; $frame_pids = $main->Frame(-borderwidth => 2, -relief => 'groove'); my @sortedKeys = ( sort keys %IdxToNickName ); for my $k (@sortedKeys) { my $pid_nickname = $IdxToNickName{$k}; my $cb = $frame_pids->Checkbutton( -text => sprintf("%-15s",$pid_nickname), # courier and -15 implies fixed length left justified -variable => \$IdxToNickNameSel{$k}, # this is a hash for the selection result (so others can access) -font => ['courier', 10, 'bold'] # and a font size ); $IdxToNickNameSel{$k} = 0; # Initialise the selection to 0 $cb->pack(-side => 'top'); # Pack the cb according to left criteria }