I want to move a widget inside of a canvas with a click of a button. Unfortunatly I always get the same Error:”_tkinter.TclError: invalid boolean operator in tag search expression”
I’ve isolated the false Code:
import tkinter as tk
root = tk.Tk()
w = tk.Canvas(root, width=200, height=200)
w.pack()
def button():
w.coords(checkbutton, 0, 0, 75, 25)
test = tk.BooleanVar()
checkbutton = tk.Checkbutton(w, text="example", variable=test, width=20, anchor="w")
w.create_window((100, 100), window=checkbutton)
button = tk.Button(w, text="Click", command=button)
button.place(x=50, y=50)
root.mainloop()
I’ve also triede the .configure method without any succsess.
Please help me if you have any suggestions.
Thanks in advance!
New contributor
CyberTigerhai is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.