this code creates a set of menus - a toolbar - from a file that can be easily edited by a user. the menus are specified in the format: set menu(window) { command "Command 1" {puts "command 1"} separator menu "Submenu 1" radiobutton "Radiobutton 1" rbutton1 {} radiobutton "Radiobutton 2" rbutton1 {::rbutton select} end checkbox "Checkbox 1" options(cbox1) {} tcl { # this is for inline tcl whose output is the syntax seen in the rest of the menu set r "" foreach x $somevar { lappend r [list command $x "::docommand $x"] } return [join $r] }