How to get callback when axes get focus

I have multiple axes on the same figure and a set of uipushtool buttons on a figure toolbar. When the user clicks different axes I want the state of the buttons to reflect that appropriate for the active axes (ie like the built-in buttons do; legend, colorbar etc). I can't find a callback function for when the axes get focus. Does this exist, or is there an alternative way of updating ui controls linked to axes?

답변 (1개)

Jan
Jan 2015년 12월 18일

0 개 추천

What about the ButtonDownFcn of the axes?

댓글 수: 1

Gaz
Gaz 2015년 12월 18일
Thanks for the suggestion Jan. I find that using ButtonDownFcn on the axes doesn't get the callback if the user clicks on a object when changing between axes, hence it often gets missed. I could also add callbacks to all the objects, but this seems over complicated.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

질문:

Gaz
2015년 12월 18일

댓글:

Gaz
2015년 12월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by