Smooth Multi-window workflow in App Designer
Ältere Kommentare anzeigen
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 Kommentare
Reto Christen
am 9 Mai 2019
Nguyen Thuan
am 21 Jul. 2020
@ 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
am 22 Jul. 2020
Antworten (0)
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!