简体   繁体   English

Python ttkwidgets - 动态更新 AutocompleteCombobox 完整值列表

[英]Python ttkwidgets - Dynamically update AutocompleteCombobox completevalues list

I have a tkinter form on which I have 2 comboboxes.我有一个 tkinter 表单,上面有 2 个组合框。 The options in the second combobox depend on what has been selected in the first one.第二个组合框中的选项取决于在第一个组合框中选择的内容。 When I use a pair of ttk.Combobox widgets, everything works OK, but if I change these to ttkwidgets.AutocompleteCombobox widgets, the second list does not populate and, strangely, I get a "TypeError: config() takes 1 positional argument but 2 were given".当我使用一对 ttk.Combobox 小部件时,一切正常,但如果我将它们更改为 ttkwidgets.AutocompleteCombobox 小部件,第二个列表不会填充,而且奇怪的是,我得到一个“TypeError:config() 需要 1 个位置参数但是给了2个”。

Is it possible to dynamically set the entries list for an AutocompleteCombobox and, if so, how?是否可以动态设置 AutocompleteCombobox 的条目列表,如果可以,如何设置?

查看ttkwidgets.AutocompleteCombobox的文档,如果您想更改完成列表,您似乎应该调用set_completion_list方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM