what is the command to open new window in gui !

Hi, I did a gui and in the gui I added a pushbutton as let say Sum so I want when the Sum pressed will open new window not in the same window so is there any command to do it ..

2 Comments

Jan
Jan on 8 Apr 2017
Edited: Jan on 8 Apr 2017
What have you tried so far and which problems occurred? Actually all you need is to insert a figure command in the callback.
I want to know how can we create multiple windows in GUI. Basically I have a main menu window in which I need to select one option from where it should enter in to new window showing the results in it. Second window should have an option to go back to main window.

Sign in to comment.

 Accepted Answer

figure
Sorry, this answer seems to be trivial. But it is the command to open a new window. Perhaps it helps. If not, please ask more specifically.

6 Comments

I want to know how can we create multiple windows in GUI. Basically I have a main menu window in which I need to select one option from where it should enter in to new window showing the results in it. Second window should have an option to go back to main window.
Fine. As I've said already, figure opens a new window. Then you can create an uicontrol on this figure, which brings the main window to front again.
function mainGUI
MainFigH = figure('Name', 'Main window');
uicontrol('Style', 'PushButton', 'String', 'Open new', ...
'Parent', MainFigH, ...
'Callback', {@pushbuttonOpen, MainFigH});
end
function pushbuttonOpen(ButtonH, EventData, MainFigH)
SubFigH = figure('Name', 'Sub window');
uicontrol('Style', 'PushButton', 'String', 'Back', ...
'Parent', NewFigH, ...
'Callback', {@pushbuttonBack, MainFigH, SubFigH});
end
function pushbuttonBack(ButtonH, EventData, MainFigH, SubFigH)
figure(MainFigH);
% delete(SubFigH); % Does "go back" means to delete the sub window?!
end
so for example I want the first figure let say calculator and it has sum and sub when the user chose sum it will open a new window and also for sub , hoe I can program the sub windows ? please
https://www.youtube.com/watch?v=bKSqFsM7zz8 see this please like what she did when she pressed a image compress it show a new window and it has its own data how I can make please ?
Sorry, Khaled, I've answered this already and posted some code. If this does not do, what you want, please take the time to explain this with any details. This would be more efficient than asking me to look a 5min movie until I understand, what you exactly want.
thanks sir I got it ...

Sign in to comment.

More Answers (0)

Categories

Find more on Functions in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!