【发布时间】:2017-02-23 15:23:33
【问题描述】:
我正在尝试编写更新条目中显示的预定义字符串的过程。
#!/bin/env wish
set tech {A B}
set rules {}
frame .t
ttk::combobox .t.maps -textvariable rules -state readonly -values $tech
entry .t.e -textvariable base_list
pack .t .t.maps .t.e
bind .t.maps <Button-1> {
switch -- $rules {
"A" {
set base_list {1 2 3}
}
"B" {
set base_list {4 5 6}
}
}
}
条目中的字符串仅在第二个组合框值选择时更新的问题。
例子:
界面启动
选择“A”
条目还是空的!
再次选择“A”
本次条目已更新
选择“B”
输入字符串仍未更新为“4 5 6”
再次选择“B”
如何修改我的代码以在第一个组合框值选择时更新条目?
【问题讨论】: