How do I copy a panel from one figure to another?
Show older comments
I have a figure A.fig and it has a panel A.pan, which is on A.fig. I have a pushbutton on A.fig that creates a new figure, B.fig, with its own panel, B.pan.
I have tons of uicontrols on both A.pan and B.pan. I have a pushbutton on B.fig that, when you hit it, should close B.fig and copy its contents (everything on B.pan) over to A.pan.
I've checked out findobj/findall, setappdata/getappdata, guidata, etc. but have not found a solution. The problem comes from A and B being completely separated. Also, I'm having a hard time figuring out what A and B are. I mean, they look like structures, but then A.fig.Parent will return a graphics root object, yet somehow I can have A.btn1, A.btn2, A.sidebar, A.text1, A.text2, A.radio1, A.radio2, and even more, which are definitely not root properties and makes me think I have a struct. I'm guessing A.fig.Parent is not the structure it belongs in, but then how do I access that structure?
Right now, I have the pushbutton on B so that it closes B.fig and makes A.pan visible, but A.pan is not a clone of B.pan, as I would like it to be.
Any help on how what A and B are, how to access them (maybe with findobj or something), and how to move the panel contents of B.pan to A.pan?
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!