Add event handler to tree window with popup menu on right click