Why does the Callback function of a uicontrol object still exist after deleting the object in GUIDE using MATLAB 7.0.4 (R14SP2)?

1 view (last 30 days)
Reproduction steps:
1.Create a GUI in GUIDE with several uicontrol objects, some of which have associated Callback functions.
2. Delete the uicontrol objects in GUIDE and then save the GUI.
The Callback functions still exist in the file that GUIDE created.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 12 Nov 2010
The ability to automatically remove Callback functions associated with deleted uicontrol objects is not available in GUIDE in MATLAB 7.11 (R2010b).
To work around this issue, you can delete the Callback functions manually.
The Callback code is not deleted automatically so that it may be reused for other uicontrols. For example, suppose I have a huge code for a callback function that is called when a PushButton is pressed. Now, suppose I wish to replace the Pushbutton with a checkbox, but have the same implementation of the callback. In such cases, I can assign the callback function to the new uicontrol. Automatically deleting Callback functions could cause valuable code to be deleted.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products


Release

R14SP2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!