+proc cascade-target-list {} {
+ global profile
+
+ foreach sub [winfo children .top.target.m.clist] {
+ puts "deleting $sub"
+ destroy $sub
+ }
+ .top.target.m.clist delete 0 last
+ foreach n [array names profile] {
+ if {$n != "Default"} {
+ set nl [string tolower $n]
+ if {[llength [lindex $profile($n) 7]] > 1} {
+ .top.target.m.clist add cascade -label $n \
+ -menu .top.target.m.clist.$nl
+ menu .top.target.m.clist.$nl
+ foreach b [lindex $profile($n) 7] {
+ .top.target.m.clist.$nl add command -label $b \
+ -command "menu-open-target $n $b"
+ }
+ } else {
+ .top.target.m.clist add command -label $n \
+ -command "menu-open-target $n {}"
+ }
+ }
+ }
+ .top.target.m.slist delete 0 last
+ foreach n [array names profile] {
+ if {$n != "Default"} {
+ .top.target.m.slist add command -label $n \
+ -command "protocol-setup $n"
+ }
+ }
+}
+