Is there a way that just by changing the element in the combobox triggers a check being sent to see what the change was and then to get the text? I want to do this without clicking a button to execute a function to find the text, i want it to be done automatically, without me using a button to check it.
Edit: So i found that i have to use trace, although when using it in an example i found documented on someone elses help post it doesnt work for me, instead it returns this error: TypeError: add_store_options_ys() takes 1 positional argument but 3 were given
here is my code, if anyone can help that would be great.
rows = 0
while rows < 50:
root.rowconfigure(rows, weight=1)
root.columnconfigure(rows, weight=1)
rows += 1
nb = ttk.Notebook(root)
nb.grid(row=1, column=0, columnspan=50, rowspan=49, sticky='NESW')
page1 = ttk.Frame(nb, style='body.TFrame')
nb.add(page1, text='Create Tasks')
specify = StringVar()
site_lbl = Label(page1, text="Site", bg='#1C2833', fg='#FDFEFE', font=("Helvetica", 14))
site_lbl.place(x=5, y=20)
site_combo = ttk.Combobox(page1, textvariable=specify, width=15, values=[
'YeezySupply'
])
site_combo.place(x=55, y=25)
def add_store_options_ys(self):
if self.specify.get() == 'YeezySupply':
store_ys()
def store_ys():
stylecode_lbl = Label(page1, text="Site", bg='#1C2833', fg='#FDFEFE', font=("Helvetica", 14))
stylecode_lbl.place(x=5, y=20)
stylecode_entry = Entry(page1, width=15, bg='#1C2833', fg='#FDFEFE', font=("Helvetica", 8))
stylecode_entry.place(x=55, y=25)
specify.trace_variable("w", add_store_options_ys)