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:
function NextButtonPushed(app, event)
This opens GUI2 with the following start-up function:
function startupFcn(app, appBefore, position)
app.subject = appBefore.subject;
app.GUI2.Position = position + [0 22 0 0];
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.