擅长:python、mysql、java
<p>combo=ttk.Combobox(frame,state=“readonly”,textvariable=varCombo,values=i.values)</p>
<p>每次循环运行时,一个新的combobox被分配给变量combo,但combobox的最终值是在最后一次迭代中设置的,因此,只反映最后一个值。您可以使用一个类来解决这个问题。
请查看以下链接:</p>
<p><a href="https://stackoverflow.com/questions/6876518/set-a-default-value-for-a-ttk-combobox">Set a default value for a ttk Combobox</a></p>