title: OpenCV Python Mouse Event Unresponsive
body: <p>I am trying to create an application using opencv, tkinter and python where people can tag their name on a photo. They write their name in a text field, and when they open the image through a GUI, they double click on the image to add their name. So, basically, when you click on the image, it is grabbing the text from a text box. I have checked effbot and the tkinter/python docs and opencv docs and I cannot see why the name from the text field will not show up on the image when I double click on it. I tried playing around with print statements to make sure that it was seeing the text from the text box and it is. The name of the text box is declared globally. Does anyone have any suggestions as to why this is not working? Thanks for any advice.</p>
  
  <pre><code> """PAINT: TAG IMAGE WITH TEXT FROM TKINTER ENTRY FIELD"""
      img = cv2.imread('photoBoothOut.jpg',0)
  
  def draw_text(event, x,y, flags,param):
      if event == cv2.EVENT_LBUTTONDBLCLK:
          cv2.putText(img,nameTextField.get(), (x,y), cv2.FONT_HERSHEY_SIMPLEX, 2, (0,0,0), 2)
          print nameTextField.get()
  
  
  def paint_canvas():
      cv2.namedWindow("Paint :: Press ESC to exit; Double Click to TAG")
      while(1):
          cv2.imshow("Paint :: Press ESC to exit; Double Click to TAG",img)
          cv2.setMouseCallback("image",draw_text)
          if cv2.waitKey(20) &amp; 0xFF ==27:
              break
      cv2.destroyAllWindows()
  
  """END PAINT"""
  </code></pre>