menu .menubar . config -menu .menubar foreach me {File Help} { set $me [menu .menubar.m$me] .menubar add cascade -label $me -menu .menubar.m$me } $File add command -label Quit -command exit $Help add command -label About -command {tk_messageBox -message "TKrun ver 0.1 by Andrew Coughlan. 2007"} label .1 -text "Program to run:" entry .e -relief sunken -width 30 -textvariable\ fname pack .1 -side left pack .e -side left if { $fname=="xterm" } then { bind .e { exec xterm } } else { bind .e { exec xterm -e $fname } }