Effacer les filtres
Effacer les filtres

Callback only works outside image on panel

2 vues (au cours des 30 derniers jours)
Chris Walker
Chris Walker le 26 Juin 2012
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

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by