📄 var1.tcl
字号:
proc About {} { return "Testing -variable option with Tix widgets"}proc Test {} { global foo bar arr set classes {tixControl tixComboBox} set value 1234 foreach class $classes { set w [$class .foo] pack $w update idletasks TestBlock var1-1.1 {$class: config -variable with initialized value} { set bar $value $w config -variable bar update idletasks Assert {[$w cget -value] == $value} } TestBlock var1-1.2 {$class: config -variable w/ uninitialized value} { destroy $w set w [$class .foo] $w config -variable bar Assert {[$w cget -value] == $bar} } TestBlock var1-1.2 {$class: config -variable} { set foo 111 $w config -variable foo update idletasks Assert {[$w cget -value] == $foo} } TestBlock var1-1.2 {$class: config -value} { $w config -value 123 Assert {[$w cget -value] == 123} Assert {[set [$w cget -variable]] == 123} } TestBlock var1-1.2 {$class: config -variable on array variable} { set arr(12) 1234 $w config -variable arr(12) Assert {[$w cget -value] == $arr(12)} } TestBlock var1-1.2 {$class: config -value on array variable} { $w config -value 12 Assert {[$w cget -value] == 12} Assert {[set [$w cget -variable]] == 12} } catch { destroy $w } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -