Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Matlab GUIDE doesn't actually save handles to all components
Replies: 1   Last Post: Jan 17, 2013 1:28 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Steven Lord

Posts: 17,945
Registered: 12/7/04
Re: Matlab GUIDE doesn't actually save handles to all components
Posted: Jan 17, 2013 1:28 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Alexandr " <chechako@ovi.com> wrote in message
> Please, can anybody explain next features?!
> M-file code:
> function pushbutton1_Callback(hObject, eventdata, handles)
> handles.myValue=999;
> disp(5);
> disp(handles);
> If start this code from M-file with F5 button in the command windows
> shows:
> 5
> figure1: 173.0032
> pushbutton1: 179.0032
> axes1: 174.0032
> output: 173.0032
> myValue: 999
> But if start clicking the .fig file, you will see only:
> 5
> myValue: 999

The function file associated with the GUI includes initialization code that
MUST run before you interact with the GUI. Double-clicking the figure file
bypasses the function file and does not execute that initialization code.

ALWAYS start a GUIDE-generated GUI by executing the function file, NOT by
opening the figure.

> In Matlab HELP it is said:
> "When the GUI is fully initialized, the handles structure contains only
> handles to all the components in the GUI and custom data added in any
> CreatedFcn callbacks and/or the OpeningFcn."
> but at the same time I see error messages about missing fields in the
> handles structure.

Note the first part of that sentence. The GUI is only fully initialized once
the associated function file executes.


Steve Lord
To contact Technical Support use the Contact Us link on

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.