package require Tk

proc mMMenu {myMenu} {
    set x [menu $myMenu]

    $x add command -label "menu1"
    $x add command -label "menu2"
    $x add command -label "menu3"
}

ttk::menubutton .m -direction below -menu .mM
mMMenu .mM
grid .m -sticky news

toplevel .t2
canvas .t2.c -width 200 -height 200
grid .t2.c -sticky news

update idletasks

after 1000 {destroy .t2}
.mM post 50 50

update idletasks


