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