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 Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by