простенькое програмко для создания множества независимых текстбоксов

 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
puts "lalala"
button .b1 -command newb1
pack .b1
set i 0
proc get_result {win i} {
upvar b${i} res
// out result
puts $res
destroy $win
}
proc newb1 {} {
global i
set win ".nb${i}"
set var "b${i}"
# init var
upvar $var val
set val "test${i}"
toplevel $win
entry $win.e -textvariable $var
pack $win.e
wm protocol $win WM_DELETE_WINDOW "get_result $win $i"
incr i
}