
update
console show
update
proc mr {w count e} {
    for {set i 0} {$i < 5} {incr i} {
	if {$e} {
	    $w insert end command -label "entry$count$i" -command "foo $i"
	}
	if {$count > 0} {
	    set m $w.m$count$i
	    menu $m
	    $w insert end cascade -label "sub$count$i" -menu $m
	    mr $m [expr {$count -1}] 1
	}
    }
}

proc foo {args} {
    puts stderr $args
}

menu .mb
update
. configure -menu .mb
mr .mb 5 0
update
