我需要将值添加到 ttk.combobox 而不重新加载整个内容。向 GUI 添加值时,不应重新加载 GUI 上的当前选择。
我需要这样的东西:
for string in listofstrings:
if string not in self.combobox1['values']:
self.combobox1['values'].append(string)
Run Code Online (Sandbox Code Playgroud)
当我像这样尝试时,出现此错误:
AttributeError: 'tuple' 对象没有属性 'append'
(正如预期的那样)。
在此先感谢您的帮助。