Borrar filtros
Borrar filtros

How to call a sub function written in GUI from another GUI?

3 visualizaciones (últimos 30 días)
Hadi Hajieghrary
Hadi Hajieghrary el 4 de Oct. de 2016
Comentada: Hadi Hajieghrary el 4 de Oct. de 2016
I have written a program which has a few user interface. Each user interface is a GUI. I want to call a sub function written in one GUI after I close the other. For example, I have a interface to select some attributes, and I need to use these attributes in a function at the main GUI after I press the select button and close it an when the focus returned to the main form.
Is there anyway to call the sub functions of a GUI from another GUI?
Thanks

Respuestas (1)

Joe Yeh
Joe Yeh el 4 de Oct. de 2016
A similar question has been asked before.
Please see the link :
Essentially, in the CloseRequestFcn of the first GUI, you'll call the other GUI you want to use, and pass data to the other GUI.
  1 comentario
Hadi Hajieghrary
Hadi Hajieghrary el 4 de Oct. de 2016
Thank you for your answer.
The problem is that the other GUI is already working, meaning I have the GUI 1. I push a button in that Form, and it opens GUI 2. Now I select some options provided in this GUI, then I close it by accepting this options. Then when the focus goes to the GUI 1 and I need it to run a function using the choices I made in GUI 2.
It is a really typical situation in for example VB, however, I could not find out how to approach it in Matlab! For example, using your suggestion, can I call a sub function in GUI 1 in CloseRequestFcn of the GUI 2?
Thank you

Iniciar sesión para comentar.

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by