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:
GUI-s strange behavior

Subject: GUI-s strange behavior

From: Marcin

Date: 27 Jun, 2010 18:20:21

Message: 1 of 4

Hi

I wrote two GUI-s, one of them is my base GUI, and the other one I open via the first one. The problem is that after I open the second GUI some of the text information located in the first GUI vanish ! Does anybody know how this happens?
Moreover after I close the second GUI I am unable to set the lost text information back

I also use the first "base" GUI to set some variables in the second GUI

Best regards
 Marcin

Subject: GUI-s strange behavior

From: Jan Simon

Date: 27 Jun, 2010 19:23:05

Message: 2 of 4

Dear Marcin!

> I wrote two GUI-s, one of them is my base GUI, and the other one I open via the first one. The problem is that after I open the second GUI some of the text information located in the first GUI vanish ! Does anybody know how this happens?
> Moreover after I close the second GUI I am unable to set the lost text information back

This is definitely not enough information to reproduce the problem.
Obviously the creation the 2nd GUI overwrites some elements of the first one. But it is impossible to guess, why you are unable to "set the lost text back".
Please show us a small relevant part of the code.

Jan

Subject: GUI-s strange behavior

From: Marcin

Date: 27 Jun, 2010 20:34:23

Message: 3 of 4

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <i088ep$236$1@fred.mathworks.com>...
> Dear Marcin!
>
> > I wrote two GUI-s, one of them is my base GUI, and the other one I open via the first one. The problem is that after I open the second GUI some of the text information located in the first GUI vanish ! Does anybody know how this happens?
> > Moreover after I close the second GUI I am unable to set the lost text information back
>
> This is definitely not enough information to reproduce the problem.
> Obviously the creation the 2nd GUI overwrites some elements of the first one. But it is impossible to guess, why you are unable to "set the lost text back".
> Please show us a small relevant part of the code.
>
> Jan
Dear Jan

Here is some relevent part of the code:

This is the opening function of th second GUI

function 2nd_GUI_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
1st_GUI_FigureHandle=1st_GUI;
1st_GUI_data=guidata(1st_GUI_FigureHandle);
handles.pathname=1st_GUI_data.pathname;

% Update handles structure
guidata(hObject, handles);

Just after the above code executes the information stored in the text box object (located in the first GUI ) disapears.
The variable "handles.pathname" contains the text information that is missing form the 1st GUI.

I would gladly post some more code...but the application I'm writing is quite big. I believe that the occurring problem is caused by the above code.

Subject: GUI-s strange behavior

From: ImageAnalyst

Date: 27 Jun, 2010 21:02:44

Message: 4 of 4

Well something's weird, because the line:
1st_GUI_FigureHandle=1st_GUI;
will actually call (launch) the first GUI, and it will accept whatever
the first GUI returns, and that most likely is not its figure handle.
Anyway, since 2nd_GUI calls 1st_GUI, the first GUI is not really the
first GUI, is it? It only comes into existence after 2nd_GUI calls
it, unless it was already running before 2nd_GUI. But look in the
OutputFcn() of your first GUI. Does it return the handle of the first
gui, or some other variables?

Maybe you should use getappdata() to pass around variables from one
GUI to another.

Tags for this Thread

No tags are associated with 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