Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to run a gui from another existing gui.

Subject: How to run a gui from another existing gui.

From: anne

Date: 21 Apr, 2010 11:54:07

Message: 1 of 8

Hi,
I would like to open an existing gui, from another existing gui, with a push button. I have made both gui's using GUIDE.
I can't get this to to work with either "run" or "open".
Is there someone who can help me?
-Anne

Subject: How to run a gui from another existing gui.

From: Sean

Date: 21 Apr, 2010 12:12:06

Message: 2 of 8

"anne " <anneschow@hotmail.com> wrote in message <hqmp0v$6ol$1@fred.mathworks.com>...
> Hi,
> I would like to open an existing gui, from another existing gui, with a push button. I have made both gui's using GUIDE.
> I can't get this to to work with either "run" or "open".
> Is there someone who can help me?
> -Anne

Your second gui should have an m-file associated with it. Put this in the callback function to your pushbutton.
e.g.

in gui1.m
pushbutton_1_Callback(stuff)
     gui2;

Subject: How to run a gui from another existing gui.

From: anne

Date: 21 Apr, 2010 12:22:04

Message: 3 of 8

"Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <hqmq2m$ni5$1@fred.mathworks.com>...
> "anne " <anneschow@hotmail.com> wrote in message <hqmp0v$6ol$1@fred.mathworks.com>...
> > Hi,
> > I would like to open an existing gui, from another existing gui, with a push button. I have made both gui's using GUIDE.
> > I can't get this to to work with either "run" or "open".
> > Is there someone who can help me?
> > -Anne
>
> Your second gui should have an m-file associated with it. Put this in the callback function to your pushbutton.
> e.g.
>
> in gui1.m
> pushbutton_1_Callback(stuff)
> gui2;

I have already tried this without success.
If I write as above, nothing happens when the button is pressed, and I don't know why..

-Anne

Subject: How to run a gui from another existing gui.

From: Sean

Date: 21 Apr, 2010 12:40:07

Message: 4 of 8

"anne " <anneschow@hotmail.com> wrote in message <hqmqlc$4ar$1@fred.mathworks.com>...
> "Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <hqmq2m$ni5$1@fred.mathworks.com>...
> > "anne " <anneschow@hotmail.com> wrote in message <hqmp0v$6ol$1@fred.mathworks.com>...
> > > Hi,
> > > I would like to open an existing gui, from another existing gui, with a push button. I have made both gui's using GUIDE.
> > > I can't get this to to work with either "run" or "open".
> > > Is there someone who can help me?
> > > -Anne
> >
> > Your second gui should have an m-file associated with it. Put this in the callback function to your pushbutton.
> > e.g.
> >
> > in gui1.m
> > pushbutton_1_Callback(stuff)
> > gui2;
>
> I have already tried this without success.
> If I write as above, nothing happens when the button is pressed, and I don't know why..
>
> -Anne


One possible problem could be that the callback function isn't actually linked to the button. You could test this by putting something like:
errordlg('Ok the call back is linked');
in the callback function for pushbutton1. Then push the button and see if the error box comes up. If it doesn't then you'll have to go into guide and change the callback function name.

If that doesn't work then you're going to have to help us out a little bit more. Can you post 'snippets' of your code, including the the callback functions, and errors that occur when you press the button.

Subject: How to run a gui from another existing gui.

From: anne

Date: 21 Apr, 2010 12:52:04

Message: 5 of 8

"Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <hqmrn7$mds$1@fred.mathworks.com>...
> "anne " <anneschow@hotmail.com> wrote in message <hqmqlc$4ar$1@fred.mathworks.com>...
> > "Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <hqmq2m$ni5$1@fred.mathworks.com>...
> > > "anne " <anneschow@hotmail.com> wrote in message <hqmp0v$6ol$1@fred.mathworks.com>...
> > > > Hi,
> > > > I would like to open an existing gui, from another existing gui, with a push button. I have made both gui's using GUIDE.
> > > > I can't get this to to work with either "run" or "open".
> > > > Is there someone who can help me?
> > > > -Anne
> > >
> > > Your second gui should have an m-file associated with it. Put this in the callback function to your pushbutton.
> > > e.g.
> > >
> > > in gui1.m
> > > pushbutton_1_Callback(stuff)
> > > gui2;
> >
> > I have already tried this without success.
> > If I write as above, nothing happens when the button is pressed, and I don't know why..
> >
> > -Anne
>
>
> One possible problem could be that the callback function isn't actually linked to the button. You could test this by putting something like:
> errordlg('Ok the call back is linked');
> in the callback function for pushbutton1. Then push the button and see if the error box comes up. If it doesn't then you'll have to go into guide and change the callback function name.
>
> If that doesn't work then you're going to have to help us out a little bit more. Can you post 'snippets' of your code, including the the callback functions, and errors that occur when you press the button.

the problem was that the button wasn't linked to the callback funktion - now it works
-Thank you

Subject: How to run a gui from another existing gui.

From: Chan Huntington

Date: 21 Apr, 2010 13:00:02

Message: 6 of 8

Hi Anne,

The previous answer is correct, you just need to call the .m file of the second gui from the first. For a very thorough video example of this check out Doug Hull's tutorial:
http://www.mathworks.com/matlabcentral/fileexchange/8616
where he addresses this issue specifically.

Subject: How to run a gui from another existing gui.

From: niyeti

Date: 2 May, 2013 08:56:07

Message: 7 of 8

"anne " <anneschow@hotmail.com> wrote in message <hqmsdk$51v$1@fred.mathworks.com>...
> "Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <hqmrn7$mds$1@fred.mathworks.com>...
> > "anne " <anneschow@hotmail.com> wrote in message <hqmqlc$4ar$1@fred.mathworks.com>...
> > > "Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <hqmq2m$ni5$1@fred.mathworks.com>...
> > > > "anne " <anneschow@hotmail.com> wrote in message <hqmp0v$6ol$1@fred.mathworks.com>...
> > > > > Hi,
> > > > > I would like to open an existing gui, from another existing gui, with a push button. I have made both gui's using GUIDE.
> > > > > I can't get this to to work with either "run" or "open".
> > > > > Is there someone who can help me?
> > > > > -Anne
> > > >
> > > > Your second gui should have an m-file associated with it. Put this in the callback function to your pushbutton.
> > > > e.g.
> > > >
> > > > in gui1.m
> > > > pushbutton_1_Callback(stuff)
> > > > gui2;
> > >
> > > I have already tried this without success.
> > > If I write as above, nothing happens when the button is pressed, and I don't know why..
> > >
> > > -Anne
> >
> >
> > One possible problem could be that the callback function isn't actually linked to the button. You could test this by putting something like:
> > errordlg('Ok the call back is linked');
> > in the callback function for pushbutton1. Then push the button and see if the error box comes up. If it doesn't then you'll have to go into guide and change the callback function name.
> >
> > If that doesn't work then you're going to have to help us out a little bit more. Can you post 'snippets' of your code, including the the callback functions, and errors that occur when you press the button.
>
> the problem was that the button wasn't linked to the callback funktion - now it works
> -Thank you

is it possible to call p code from a gui?

Subject: How to run a gui from another existing gui.

From: Richiegabrielmartin

Date: 29 May, 2014 21:50:09

Message: 8 of 8

"niyeti" wrote in message <klt9n7$nr2$1@newscl01ah.mathworks.com>...
> "anne " <anneschow@hotmail.com> wrote in message <hqmsdk$51v$1@fred.mathworks.com>...
> > "Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <hqmrn7$mds$1@fred.mathworks.com>...
> > > "anne " <anneschow@hotmail.com> wrote in message <hqmqlc$4ar$1@fred.mathworks.com>...
> > > > "Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <hqmq2m$ni5$1@fred.mathworks.com>...
> > > > > "anne " <anneschow@hotmail.com> wrote in message <hqmp0v$6ol$1@fred.mathworks.com>...
> > > > > > Hi,
> > > > > > I would like to open an existing gui, from another existing gui, with a push button. I have made both gui's using GUIDE.
> > > > > > I can't get this to to work with either "run" or "open".
> > > > > > Is there someone who can help me?
> > > > > > -Anne
> > > > >
> > > > > Your second gui should have an m-file associated with it. Put this in the callback function to your pushbutton.
> > > > > e.g.
> > > > >
> > > > > in gui1.m
> > > > > pushbutton_1_Callback(stuff)
> > > > > gui2;
> > > >
> > > > I have already tried this without success.
> > > > If I write as above, nothing happens when the button is pressed, and I don't know why..
> > > >
> > > > -Anne
> > >
> > >
> > > One possible problem could be that the callback function isn't actually linked to the button. You could test this by putting something like:
> > > errordlg('Ok the call back is linked');
> > > in the callback function for pushbutton1. Then push the button and see if the error box comes up. If it doesn't then you'll have to go into guide and change the callback function name.
> > >
> > > If that doesn't work then you're going to have to help us out a little bit more. Can you post 'snippets' of your code, including the the callback functions, and errors that occur when you press the button.
> >
> > the problem was that the button wasn't linked to the callback funktion - now it works
> > -Thank you
>
> is it possible to call p code from a gui?


Hello...my callback function is linked.....but it is not working when im pressing the push button....can you please help me out with this...

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us