如何在tcl tk组合框中进行选择后运行脚本

SIM*_*MEL 3 user-interface tk-toolkit tcl

我正在使用ttk::combobox,我想在每次做出选择时运行脚本.但是在文档中只-postcommand存在一个选项,它在选择之前运行脚本.如何在选择后运行脚本(我希望能够知道何时做出选择).

此外,组合框也是-state readonly如此,因此无法通过条目进行选择.

Don*_*ows 5

绑定到<<ComboboxSelected>>虚拟事件,组合框在每次选择项目后生成.

bind .combo <<ComboboxSelected>> {puts "chosen [%W get]"}
Run Code Online (Sandbox Code Playgroud)