set buttons "" foreach i {a b c d e f g} { lappend buttons [button .$i -text $i -highlightcolor red \ -highlightthickness 6 -command "focus .$i"] } eval pack $buttons -side left -expand y -fill both