Filter löschen
Filter löschen

Callback only works outside image on panel

2 Ansichten (letzte 30 Tage)
Chris Walker
Chris Walker am 26 Jun. 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

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by