Thread Subject: GUI OpeningFcn

Subject: GUI OpeningFcn

From: GUI

Date: 10 Jul, 2007 08:43:41

Message: 1 of 6

Hello there!
I am creating an interface with GUIDE from Matlab.
I noticed that only the very first "form" I load gets its own
OpeningFcn loaded! If I use the callback function to navigate through
other forms/windows no OpeningFcn of those forms/windows will be
loaded!!!
How can I solve this? I need to init the form properties (popups,
radio buttons, ...)
Regards.

Subject: GUI OpeningFcn, plz clarify

From: Fadel Megahed

Date: 10 Jul, 2007 09:16:36

Message: 2 of 6

Hi,

Plz clarify whats ur problem is that u want to set the callbacks of
the uicontrols or is that you want to influence the opening function
in such a way that to do certain action before the GUI window opens ??

Subject: GUI OpeningFcn, plz clarify

From: GUI

Date: 10 Jul, 2007 09:54:32

Message: 3 of 6

Fadel Megahed wrote:
>
>
> Hi,
>
> Plz clarify whats ur problem is that u want to set the callbacks of
> the uicontrols or is that you want to influence the opening
> function
> in such a way that to do certain action before the GUI window opens
> ??
  
I've been using the OpeningFcn to certain actions when the GUI window
opens! However if I load another .fig file ("dummy" for example)
using the openfig() function the OpeningFcn from dummy won't be run.
How can I init certain properties for each figure?

Subject: GUI OpeningFcn, plz clarify

From: Fadel Megahed

Date: 10 Jul, 2007 10:15:40

Message: 4 of 6

OOPs posted it as new message

If u need to open the fig in the GUI itself
just under
%uiwait (handles.figure1)
just put in this code after creating an axes lets say axes1
 
logo = imread ('dummy.jpg');
axes (handles.axes1)
imshow (logo)
 
If u want to open it as a seperate figure, then instead of axes
(handles.axes1); imshow (logo);
put
figure, imshow (logo)
 
Did I understand correctly?

Subject: GUI OpeningFcn, plz clarify

From: Steven Lord

Date: 10 Jul, 2007 10:20:58

Message: 5 of 6


"GUI" <ossadas@hotmail.com> wrote in message
news:ef5cfc8.1@webcrossing.raydaftYaTP...
> Fadel Megahed wrote:
>>
>>
>> Hi,
>>
>> Plz clarify whats ur problem is that u want to set the callbacks of
>> the uicontrols or is that you want to influence the opening
>> function
>> in such a way that to do certain action before the GUI window opens
>> ??
>
> I've been using the OpeningFcn to certain actions when the GUI window
> opens! However if I load another .fig file ("dummy" for example)
> using the openfig() function the OpeningFcn from dummy won't be run.
> How can I init certain properties for each figure?

Don't use OPENFIG. Call the M-file associated with the GUI. That will
cause the OpeningFcn to be called.

--
Steve Lord
slord@mathworks.com

Subject: GUI OpeningFcn, plz clarify

From: GUI

Date: 10 Jul, 2007 12:22:23

Message: 6 of 6

Thank you Steven Lord.
You solved my problem. Simple and clear answer.
Regards.

 Steven Lord wrote:
>
>
>
> "GUI" <ossadas@hotmail.com> wrote in message
> news:ef5cfc8.1@webcrossing.raydaftYaTP...
>> Fadel Megahed wrote:
>>>
>>>
>>> Hi,
>>>
>>> Plz clarify whats ur problem is that u want to set the
callbacks
> of
>>> the uicontrols or is that you want to influence the opening
>>> function
>>> in such a way that to do certain action before the GUI
window
> opens
>>> ??
>>
>> I've been using the OpeningFcn to certain actions when the GUI
> window
>> opens! However if I load another .fig file ("dummy" for
example)
>> using the openfig() function the OpeningFcn from dummy won't be
> run.
>> How can I init certain properties for each figure?
>
> Don't use OPENFIG. Call the M-file associated with the GUI. That
> will
> cause the OpeningFcn to be called.
>
> --
> Steve Lord
> slord@mathworks.com
>
>
>

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us at files@mathworks.com