MATLAB: Suppress callbacks generated by GUIDE

callbackguiguide

In GUIDE, there is a "View Callbacks" menu option to let one add additional callbacks for a particular uicontrol to the mfile that GUIDE generates. However, is there a way to suppress certain callbacks from being added to the mfile, so as to minimize clutter? There are certain callbacks, e.g., CreateFcn's, for which I know I will always be using the default.

Best Answer

You can always retroactively delete the callbacks in the property inspector and in the generated MATLAB file.
Possibly this is what Sean was already implying, but I just discovered that if you delete code for a callback completely from the generated mfile, they won't come back when GUIDE updates the mfile with further changes. To restore a deleted callback, you just have to use the uicontrol's "View Callback" menu option.
This is ultimately what I was looking for. I had assumed, incorrectly, that a GUIDE update would always regenerate callbacks in the mfile for all uicontrols in the GUI.
+1 to Sean and thanks to everyone else.