tcl_tk.tcl
1.01 KB
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
# Syntax Highlighting Test File for TCL/TK
# Comments are like this
# Hello World in tcl/tk
wm title . "Hello world!"
frame .h -borderwidth 2
frame .q -borderwidth 2
button .h.hello -text "Hello world" \
-command "puts stdout \"Hello world!\"" -cursor gumby
button .q.quit -text "Quit" -command exit -cursor pirate
pack .h -side left
pack .q -side right
pack .h.hello
pack .q.quit
# Procedure Definition
proc printArguments args {
foreach arg $args {
puts $arg
}
}
proc foo::xxxx {} {
set a xxxxxxxxxxxx
}
proc foo_bar {} {
set b xxxxxxx
}
proc foo::yyyy {} {
set a bbbbbbb
}
# SNIT
package provide test 1.0
snit::widgetadaptor mySnit {
package require mypack 2.2
constructor {args} {
installhull using text -insertwidth 0
$self configurelist $args
}
typevariable myList [list]
typemethod list {} {
return $myList
}
# Disable the insert and delete methods, to make this readonly.
method insert {args} {}
method delete {args} {}
}