This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Why Are Callbacks and Application Data Not Copied?

Starting in R2014b, copyobj does not copy callback properties or application data associated with graphics objects. The copied object has callbacks set to empty character arrays and application data set to empty structure arrays. Copies of objects might not behave as expected. For example, clicking a push button on the copy of a uicontrol has no effect.

If you want to create a copy of an object that has callbacks, then rerun the code used to create the first object to create a second object.

If you have existing code that uses copyobj to copy callbacks, then you can use copyobj with the 'legacy' option, for example, c = copyobj(h,p,'legacy'). The behavior of the 'legacy' option is consistent with versions of MATLAB® before R2014b.

See Also