-
Notifications
You must be signed in to change notification settings - Fork 5
/
menus_list.tcl
39 lines (38 loc) · 962 Bytes
/
menus_list.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# $Id$
#
# Handles browsing menus.
#
widget menus_list {
object_include tkinspect_list
param title "Menus"
method get_item_name {} { return menu }
method update_self {target} {
$slot(main) windows_info update $target
$self update $target
}
method update {target} {
$self clear
foreach w [$slot(main) windows_info get_windows] {
if {[$slot(main) windows_info get_class $target $w] == "Menu"} {
$self append $w
}
}
}
method retrieve {target menu} {
set end [send $target $menu index end]
if {$end == "none"} { set end 0 } else { incr end }
set result "# menu $menu has $end entries\n"
for {set i 0} {$i < $end} {incr i} {
append result "$menu entryconfigure $i"
foreach spec [send $target [list $menu entryconfig $i]] {
append result " \\\n\t[lindex $spec 0] [list [lindex $spec 4]]"
}
append result "\n"
}
return $result
}
method send_filter {value} {
return $value
}
}