I have the position data in the SQLite DB(employee_position). As well it's fetching the data for the position:
self.employee_position = employee_info[0][8]
However, I'm not able to insert the data. How can I insert the data into the combobox?
It does work for other fields like Entry:
#Entry
self.email_entry.insert(0, self.employee_email)
self.email_entry.config(state = 'disabled')
# Position
self.available = self.employee_position
self.position_lbl = Label(self.centerFrame, text = 'Position:', fg = '#b3b3b3', bg = '#121212')
self.position_lbl.grid(row = 7, column = 0, sticky = W, columnspan = 2, padx = 5)
self.position = ttk.Combobox(self.centerFrame, values=self.available, width = 27)
self.position.config(state = 'disabled')
self.position.grid(row = 7, column = 1, sticky = W, columnspan = 2, pady = 5)
Solution: # Position
self.available = [self.employee_position]
self.position_lbl = Label(self.centerFrame, text = 'Position:', fg = '#b3b3b3', bg = '#121212')
self.position_lbl.grid(row = 7, column = 0, sticky = W, columnspan = 2, padx = 5)
self.position = ttk.Combobox(self.centerFrame, values=(self.available), width = 27)
self.position.set(self.employee_position)
self.position.config(state = 'disabled')
self.position.grid(row = 7, column = 1, sticky = W, columnspan = 2, pady = 5)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.