menubutton .m -text "MenuButton" -menu .m.m menu .m.m pack .m proc foobar {entry args} { puts "foobar says: menu '$entry' sent me: $args" } foreach q { this is a test of the dynamic menu system.} { .m.m add command -label $q -command "foobar $q blah blah blah" }