Callback only works outside image on panel

1 次查看(过去 30 天)
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

采纳的回答

Tom
Tom 2012-6-26
You will need to set the image's Button Down Function, in the same way as for the panel.
  1 个评论
Chris Walker
Chris Walker 2012-6-27
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by