Using ButtonDownFcn on textboxes that are on top of an axes

조회 수: 2 (최근 30일)
ryan
ryan 2013년 5월 30일
For some reason the buttondownfcn will not work for textboxes that are on top of an axes. I am using the axes for the background image, and am turning hittest off for the axes, and it is still not working. It works the second I get rid of the axes though. Is there any workaround/fix for this?
  댓글 수: 2
Walter Roberson
Walter Roberson 2013년 5월 30일
Is this uicontrol('style', 'text') or is this text() ?
uicontrol are never on top of axes, nor below them: uicontrol are always direct children of figures (or uipanel) rather than being something "drawable" that axes would have reference to.
ryan
ryan 2013년 5월 30일
They are uicontrol. But the thing is when they are on top of an axes, the buttondownfcn will not work when I right click the text. But when I delete the axes, and the static text is just on top of the panel, the buttondownfcn callback is executed just fine.

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

채택된 답변

Walter Roberson
Walter Roberson 2013년 5월 31일
In R2013a, all I had to do was turn hittest off for the axes.

추가 답변 (1개)

ryan
ryan 2013년 5월 31일
For 2011b, it does not seem to work. Thanks for the help.

카테고리

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