필터 지우기
필터 지우기

figure handle from uitree-javahandle

조회 수: 2 (최근 30일)
Steffen
Steffen 2011년 9월 8일
hi there,
i use a gui that consists of different elements, that -lets say, they dont know each other. since they still need to communicate, they share data via the figure they are all nested in (setappdata/ getappdata). so far, everything works fine.
now heres the problem: one of the elements is a uitree, to which i added a context menu by implementing a mousePressed-callback, which is a property of the uitree-javahandle. now, when running the callback, there is obviously only the javahandle available, not the common handles-struct that you get in - lets call them GUIDE-callbacks :) to be precise its a javahandle_withcallbacks.com.mathworks.hg.peer.utils.UIMJTree.
so the question is: is there ANY way to get the figure handle from this javahandle?? (since i need the figure handle to share data). i tried gcf, but somehow it only returns 1 (which means a new figure) when called from within the callback.
EDIT: just found the TopLevelAncestor-property which return a com.mathworks.hg.peer.FigureFrameProxy$FigureFrame, which somehow must be the javaobject of the figure, but i still dont have a clue how to get the figure-handle :(
thanks in advance,
steffen

답변 (1개)

Steffen
Steffen 2011년 9월 11일
ok, so at least i found out why gcf returned a new figure. it was hidden from within the callback. turning the root-property 'ShowHiddenHandles' on made it visible again, so this seems to work now :)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by