#!/usr/bin/wish set n_group 4 set n_item 3 for {set i 0} {$i < $n_group} {incr i} { frame .f$i -bd 4 -bg gray pack .f$i -side left bind .f$i