Strange behavior of GUI with GUIDE
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Hello,
I'm trying to build a GUI by combining GUIDE and the GUI Layout Toolbox. I would like to build a multitab GUI very quickly, but with a large amount of components. It takes a long time to write the code, and I would like to focus on the callback's and not on the components positionning.
To do so, I found a way that could work :
- build each tab content wrapped in a panel in separate GUIDE figure,
- write a main script that open figures in invisible mode
- add the panels in each tabs
The process is working well if we take care to change units of all components to "normalized" (it is also a tip to resize easyly GUI's created with GUIDE)
For the moment I see three ways to do this : In the following code, create_Pipe is a nested function that opens the fig PipePanel created with GUIDE, get the handles structure A
- 1) generate the mfile that include the handles of each components and use copyobj(panel,tab).
function create_Pipe()
[~,A]=PipePanel('visible','off');
newPipe=copyobj(A.PipePan,h.mainTab);
end
- 2) Change the Parent of the panel:
function create_Pipe()
[~,A]=PipePanel('visible','off');
set(A.PipePan,'Parent',double(h.mainTab));
end
It works, my components (all children of the panel) are well transferred, I have acces to all components properties with struc A.
But when I close and reload, it doesent work (invalid object/handles)
When I launch PipePanel with the code of GUIDE, nothings appears. When I reload GUIDE, all become OK
I really don't understand what happens !
- 3) Generate only the figure, and retrieve all components using findobj. It works but not the more efficient way
Do you have any Idea about the bug, or an other solution to import components with handles ?
Thank you in advance
0 件のコメント
この質問は閉じられています。
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!