how to create a transparent rectangle responding to click event in Tkinter

前端 未结 2 1112
心在旅途
心在旅途 2021-01-20 10:03

I need to draw a rectangle in a tkinter.canvas to respond click event:

click_area = self.canvas.create_rectangle(0,0,pa_width,pa_height,fill=\'LightBlue\',ou         


        
2条回答
  •  旧巷少年郎
    2021-01-20 10:46

    I think I got it: Bind the canvas, not the rectangle.

    replace

    self.canvas.tag_bind('CLICK_AREA','

    with

    self.canvas.bind('

    problem solved.

提交回复
热议问题