set have_remote 0
foreach r $all_remotes {
- set have_remote 1
+ incr have_remote
}
set remote_m .mbar.remote
set fetch_m $remote_m.fetch
set prune_m $remote_m.prune
- if {$have_remote} {
+ if {$have_remote > 1} {
make_sure_remote_submenues_exist $remote_m
- set index [expr {[$fetch_m type 0] eq "tearoff" ? 1 : 0}]
- if {[$fetch_m entrycget $index -label] ne "All"} {
+ if {[$fetch_m type end] eq "command" \
+ && [$fetch_m entrycget end -label] ne "All"} {
- $fetch_m insert $index separator
- $fetch_m insert $index command \
+ $fetch_m insert end separator
+ $fetch_m insert end command \
-label "All" \
-command fetch_from_all
- $prune_m insert $index separator
- $prune_m insert $index command \
+ $prune_m insert end separator
+ $prune_m insert end command \
-label "All" \
-command prune_from_all
}
} else {
if {[winfo exists $fetch_m]} {
- set index [expr {[$fetch_m type 0] eq "tearoff" ? 1 : 0}]
- if {[$fetch_m type end] eq "separator"} {
+ if {[$fetch_m type end] eq "command" \
+ && [$fetch_m entrycget end -label] eq "All"} {
- delete_from_menu $fetch_m $index
- delete_from_menu $fetch_m $index
+ delete_from_menu $fetch_m end
+ delete_from_menu $fetch_m end
- delete_from_menu $prune_m $index
- delete_from_menu $prune_m $index
+ delete_from_menu $prune_m end
+ delete_from_menu $prune_m end
}
}
}