-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinterface.tcl
76 lines (63 loc) · 1.58 KB
/
interface.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#
# $Id$
#
# Provide a uniform interface to tkinspect's actions.
#
# look for a main window
proc tkinspect_main_window {} {
for {set i 0} {1} {incr i} {
if [winfo exists .main$i] {
return .main$i
}
}
}
proc tkinspect_show_list {list} {
set main [tkinspect_main_window]
$main add_list ${list}_list
}
proc tkinspect_remove_list {list} {
set main [tkinspect_main_window]
$main.lists.${list}_list remove
}
proc tkinspect_set_target {target} {
set main [tkinspect_main_window]
$main set_target $target
}
proc tkinspect_select {type thing} {
set main [tkinspect_main_window]
if {$type == "canvas"} { set type canva } ;# terrible hack
$main.lists.${type}s_list run_command $thing
}
proc tkinspect_create_cmdline {} {
set main [tkinspect_main_window]
$main add_cmdline
}
proc tkinspect_help {{topic ""}} {
global tkinspect
if ![string length $topic] {
set topic [lindex $tkinspect(help_topics) 0]
}
set main [tkinspect_main_window]
$main help $topic
}
proc tkinspect_value_window {} {
return [tkinspect_main_window].value
}
proc tkinspect_value_text_widget {} {
return [tkinspect_main_window].value.t
}
proc tkinspect_send_value {} {
[tkinspect_value_window] send_value
}
proc tkinspect_detach_value {} {
[tkinspect_value_window] detach
}
proc tkinspect_trace_global {var} {
set main [tkinspect_main_window]
create_variable_trace $main [$main target] $var
}
proc tkinspect_display_image {image} {
set main [tkinspect_main_window]
tkinspect_select image $image
$main.lists.images_list display_image
}