問題描述
tcl/tk 小部件組合框失去焦點 (tcl/tk widget combobox loses focus)
tcl/tk 小部件 iwidgets::combobox 有一個可怕的缺陷:當列表消失時,焦點會從 gui 上移開,因此除非您將鼠標移出 gui 並移回,否則您無法輸入輸入框
這個問題在其他地方已經註意到了,但是我沒有看到任何解決方案。 a. 有沒有辦法在退出命令(‑command 選項)之前重新獲得焦點?灣。是否有更好的組合框小部件可用?我已經嘗試過 BWidgets 的 ComboBox,但無法讓它發揮作用....我不想自己構建。
參考解法
方法 1:
As of Tcl/Tk 8.5, there is a combobox widget built into the core language as part of the Tile set of widgets. The command is ttk::combobox
. You can download a prebuilt version of Tcl/Tk from ActiveState, at:
http://www.activestate.com/activetcl/
For more information, see the documentation here:
http://docs.activestate.com/activetcl/8.5/tcl/TkCmd/ttk_combobox.htm
HTH,
Eric Melski
(by Byron Caloz、Eric Melski)