'How can I insert a data from my table to a combobox read-only?
This is a school activity, here is the complete code.
I want to insert data from my table value to Combobox read-only. I also can't clear the text from the two Combobox when they are in a read-only state. I also wish to remove auto highlighting for aesthetic purposes.
#Gender label and input box
data_label5 = Label(section3, text="Gender:")
data_label5.grid(row=4, column=0, padx=(30, 0), pady=3)
data_label5_entry = ttk.Combobox(section3, textvariable=t5, width=18, state="readonly")
data_label5_entry['values'] = ['Male', 'Female']
data_label5_entry.grid(row=4, column=1, padx=5, pady=3)
# Employment Date label and inputbox
data_label10 = Label(section3, text="Employment Date:")
data_label10.grid(row=2, column=2, padx=(30, 0), pady=3)
data_label10_entry = DateEntry(section3, textvariable=t10, width=18, state="readonly")
data_label10_entry.set_date(None)
data_label10_entry.delete(0, 'end')
data_label10_entry.grid(row=2, column=3, padx=5, pady=3)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|