我在 TCL/Tk 应用程序中有以下内容:
proc greyout { } {
puts "current part $DSM::Part"
switch $DSM::Part {
Doghouse {
for {set entry 1} {$entry<17} {incr entry} {
.dsm.traceCTRpart$entry configure -state disabled
.dsm.traceLATpart$entry configure -state disabled
.dsm.traceStowage$entry configure -state disabled
.dsm.traceDoghouse$entry configure -state enabled}
}
Stowage {
for {set entry 1} {$entry<17} {incr entry} {
.dsm.traceCTRpart$entry configure -state disabled
.dsm.traceLATpart$entry configure -state disabled
.dsm.traceStowage$entry configure -state enabled
.dsm.traceDoghouse$entry configure -state disabled}
}
}
}
trace add variable DSM::Part write greyout
每次“部分”更改跟踪尝试调用灰色但我收到以下消息:
wrong # args: should be "greyout"
wrong # args: should be "greyout"
while executing
"greyout Part {} write"
(write trace on "Part")
invoked from within
"variable Part "CTR_Partition""
(in namespace eval "::DSM" script line 3)
invoked from within.....
我不明白为什么?!有什么帮助吗?