MATLAB: Add new window to OpeningFcn of MATLAB gui goes to back of main window when running

guideMATLABmatlab gui

I have a 'Main_window' in MATLAB guide. I want open a 'New_window' when I run 'Main_window', So I add this code in 'OpeningFcn' of 'Main_window' :
New_window();
When I run 'Main_window', 'New_window' goes to back of 'Main_window'. I want it in front of 'Main_window' after running.
What should I do?
Thanks.

Best Answer

Jack - to be clear, you want to launch a second GUI from the first without any user interaction such that the second GUI appears in front of the first? If so, try adding the line of code New_window() to the OutputFcn of the Main_window.