MATLAB: Callback only works outside image on panel

axesborderbuttondownfcnclickimageMATLABmousepanel

I have a set of images which are displayed in axes which are in turn each displayed in a separate panel. I have setup a buttondownfcn for each panel, and I have set 'HitTest' to 'off' for the image and axes. I would like the program to do something when an image is clicked. However, I find that the buttondownfcn for the panel only works if I click outside the image near the panel title. How can I get the program to detect if an image has been clicked on? Is there any way to determine what is detecting my button clicks and divert the attention to the underlying panel? Thanks Chris

Best Answer

You will need to set the image's Button Down Function, in the same way as for the panel.