package require Tk

wm title . root

menu .menubarA
menu .menubarA.cascade
.menubarA.cascade add command -label "A 1"
.menubarA.cascade add command -label "A 2"
.menubarA add cascade -label "Menu A" -menu .menubarA.cascade

menu .menubarB
menu .menubarB.cascade
.menubarB.cascade add command -label "B 1"
.menubarB.cascade add command -label "B 2"
.menubarB add cascade -label "Menu B" -menu .menubarB.cascade

menu .menubarC
menu .menubarC.cascade
.menubarC.cascade add command -label "C 1"
.menubarC.cascade add command -label "C 2"
.menubarC add cascade -label "Menu C" -menu .menubarC.cascade

toplevel .t1
.t1 configure -menu .menubarA
wm title .t1 First
update idletasks

toplevel .t2
.t2 configure -menu .menubarB
wm title .t2 Second
update idletasks

toplevel .t3
.t3 configure -menu .menubarC
wm title .t3 Third 
update idletasks
