필터 지우기
필터 지우기

Callback only works outside image on panel

조회 수: 2 (최근 30일)
Chris Walker
Chris Walker 2012년 6월 26일
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