title: How can i see in which tkinter canvas shape is clicked?
body: <p>I have a simple program, with some buttons who are not made by Tkinter self. I just made them with <code>canvas.create_rectangle</code> and things like that. But the problem is: The buttons can move. I can do it like this:</p>
  
  <pre><code>if event.x &gt; c.coords(button)[0] and event.y &gt; c.coords(button)[1] \
  and event.x &lt; c.coords(button)[2] and event.y &lt; c.coords(button)[3]:
      ::line of code::
  </code></pre>
  
  <p>But is there a shorter way? Thanks!</p>