# Dictionary with options
choices = c.execute('SELECT time date FROM data')
tkvar.set('Select date and time')
lablemen= tk.Label(self, text = "Select start time", font=('helvetica', 20, 'bold'))
lablemen.grid(row = 1 , column = 1)
popupMenu = tk.OptionMenu(self, tkvar, *choices)
popupMenu.config(font=('helvetica', 15, 'bold'))
popupMenu.grid(row = 2 , column = 1)
我如何从选项菜单转到组合框?
我尝试过
choices2 = c.execute('SELECT time date FROM data')
cb = ttk.Combobox(self)
cb.grid(row = 3, column = 1)
cb['values'] = choices2
它给了我combobox result
答案 0 :(得分:0)
想通了
cb = ttk.Combobox(self)
cb.grid(row = 3, column = 1)
cblist = list()
for row in c.execute('SELECT time date FROM data'):
cblist.append(row)
cb['values'] = cblist