I want my half circle to be bolded when I click. Currently, it keeps drawing as already bold.
import tkinter as tk
root = tk.Tk()
canvas = tk.Canvas(root, width=300, height=200, bg='black')
canvas.pack(fill="both", expand=True)
# when you click on the half circle, it becomes bold
half_circle = canvas.create_arc(100, 0, 200, 100, start=0, extent=-180, outline="white", style="arc")
def bold():
canvas.itemconfigure(half_circle,width=2.5)
canvas.tag_bind(half_circle,"<Button-1>", bold())
root.mainloop()
Update: I changed bold()
to bold(event)
, and am also passing bold
. Still not working. I think it could be a problem with PyCharm. Even when I ask it to just print("random")
after a click, when the window opens "random" prints immediately and I can't seem to interact with it after.
Second update: I wasn't clicking the exact outline, and now understand the difference between calls and callbacks. lol