User`s guide
R2007a
20-36
Creating Graphical User Interfaces (GUIs)
GUIDE No Longer Copies Callbacks When You Duplicate Components
In GUIDE, when you copy a component for which one or more of its callback properties
are defined, the callback properties of the newly created component are now set to their
default values, the ones you get when adding a component directly from the Component
Palette. Previously, their values were copied from the corresponding callback properties
of the original component. New callback subfunctions can be generated in the GUI M-file
for the new component in the same way as for any component in the GUIDE layout.
Compatibility Considerations
If you have relied on the old behavior, in which the callbacks properties of the new
component point to the callbacks of the original component, you will now have to
explicitly change the callback properties, using the Property Inspector, to do that.
GUIDE M-File-Defined handles Structure Fields No Longer Become
Permanent
The handles structure that is provided to every GUIDE generated callback subfunction
in the GUI M-file is constructed at runtime every time the GUI runs. 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.
Previously, fields that the M-file had added to the handles structure could sometimes
become a permanent part of the structure.
Compatibility Considerations
If your GUI runs well but displays error messages about missing fields in the handles
structure when starting up, you may have to update the code in the GUI M-file where
those fields are accessed. You may need to initialize those handles fields properly in a
CreateFcn callback and/or in the OpeningFcn.