Callback only works outside image on panel

2 views (last 30 days)
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

Accepted Answer

Tom
Tom on 26 Jun 2012
You will need to set the image's Button Down Function, in the same way as for the panel.
  1 Comment
Chris Walker
Chris Walker on 27 Jun 2012
Thanks, unfortunately, our image display code is buried under several layers and modifying it proved to be difficult, but we succeeded in the end.
We did come across some code called imageviewer.m
(http://sector7.xor.aps.anl.gov/~dufresne/Manuals/Pilatus/Contrib/DFritz-KGaffney-Aug07/imageviewer.m)
which appeared to take the mouse click from the panel and switch off the hittest on the axes and image.
However, we still don't understand how this works!
Nevertheless - problem solved.
Chris

Sign in to comment.

More Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!