title: Python Tkinter canvas.tag_bind()
body: <p>I've been writing this code on Python using Tkinter also, that at the end of the day, i'll be able to click on a picture ( and not on a specific dot with a x,y in the picture's borders, but anywhere in the entire picture's borders ) and then click anywhere on the screen, and be able to move it there.</p>
  
  <p>My code:</p>
  
  <pre><code>from Tkinter import *
  from PIL import ImageTk, Image
  
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  #Constants~
  CLICKED = False
  
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  #Classes and Functions~
  class App(Frame):
      def __init__(self, master=None):
          Frame.__init__(self, master)
          self.pack()
  
  def asign_click(event):
      CLICKED = True
      print CLICKED
  def new_destination(event, x, y, canvas, picture):
      if CLICKED == True:
          canvas.move(picture, x, y)
  
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  #Main~
  myapp = App()
  myapp.master.title("DA-I-SUKI!! &lt;3~")
  myapp.master.maxsize(2000, 1200)
  
  my_picture = ImageTk.PhotoImage(Image.open("SOME_PICTURE"))
  canvas = Canvas(height = my_picture.height(), width = my_picture.width())
  canvas.pack(expand=1, fill=BOTH)
  picture_pack = canvas.create_image(1130, 500, image = my_picture)
  
  canvas.tag_bind(my_picture, '&lt;1&gt;', asign_click) 
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  myapp.mainloop()
  </code></pre>
  
  <p>Basically, I want the tag_bind at the end of the code to work so it can call asign_click(), and change CLICKED's constant value to TRUE, and then add another tag_bind ( or anything else to work ) that'll allow me to click anywhere on the screen and call new_destination() so it'll move the picture to its new destination. </p>
  
  <ul>
  <li>I might've put wrong parameters on new_destination() function, still working on it.</li>
  </ul>
  
  <p>Thanks a lot in advance.</p>