Smooth Multi-window workflow in App Designer
이전 댓글 표시
I am building an application with several windows. My goal is to create a workflow which looks like a common "installation workflow" (e.g. installation of Matlab).
My app works, but I have some graphical issues while opening the new window.
When I hit "Next"-Button on my first GUI (let's call it GUI1), the following code is called:
% Button pushed function: Next
function NextButtonPushed(app, event)
% start GUI2 window
GUI2(app, app.GUI1.Position);
end
This opens GUI2 with the following start-up function:
% Code that executes after component creation
function startupFcn(app, appBefore, position)
% copy subject (struct of data) to new app
app.subject = appBefore.subject;
% get same position as app before + [Menu Bar shift]
app.GUI2.Position = position + [0 22 0 0];
% close app before
delete(appBefore);
end
This works fine while debugging step-by-step. As soon as I run it without debugging, I have a problem with closing my first app (GUI1). In my opinion GUI1 should be closed after GUI2 is loaded, therefore, we should not even see GUI1 closing. For the user it should be more like another page. Unfortunately, while running the apps normally GUI1 is closing even before GUI2 is plotted. I believe this must be a graphical issue (small delay with plotting the new window). A pause() statement before delete(appBefore) actually does what I want. Unfortunately, the delay time is quite random, which makes it unusable. Is there a solution to wait until the app is loaded completely before executing delete(appBefore)?
Another small issue is this menu bar shift. I do not really understand why having a menu bar increases my window size after the first time it is plotted. So far, I could not find a better workaround than adding this shift.
I would appreciate any help. Thanks a lot.
댓글 수: 3
Reto Christen
2019년 5월 9일
Nguyen Thuan
2020년 7월 21일
@ Reto Christen: Hi Reto. I am designed an app that is similar to yours: My wanted workflow is the same as the process of installation a software.
Could you explain what is GUI1 and GUI2 in your code? Are they separate .mlapp files (separate apps) or just functions that you created?
Is it possible for you to upload your source code?
Thanks a lot!
Reto Christen
2020년 7월 22일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!