So far, we have seen how to bind events to widgets; however, it is also possible to do so for canvas items. This helps us to write more specific and simpler event handlers, instead of binding all the types of events we want to process on the Canvas instance and then determining which action has to be applied according to the affected item.
Binding events to canvas items
Getting ready
The following application shows how to implement the drag and drop functionality on canvas items. This is a common functionality that serves to illustrate how this approach can simplify our programs.