which tree node fires a context menu

조회 수: 6 (최근 30일)
Peng Li
Peng Li 2021년 3월 22일
댓글: Steven Nittel 2021년 6월 27일
I have a specific question about the context menu for uitree. It seems that there is no way to identify within the ContextMenuOpening or ContextMenuSelected callbacks which specific tree node fires this call. The two callbacks only accepts app and event as input. There isn't a source variable that is allowed. However, Source is also a field of event struct, but this event.Source points to the context menu, not the source that fires it.
any solution?
  댓글 수: 1
Steven Nittel
Steven Nittel 2021년 6월 27일
You can add a dedicated context menu to each tree node and give it a Tag and/or UserData.
The event source will contain the Tag as well as the UserData.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by