copyobj changes between R2012 and R2014

Hi,
hPushButton is a handle to a pushbutton.
hGroup ia a handle to a Button group (containing hPushButton as the only element at this time. They were both dreated with GUIDE.
I want to duplicate the button several times, so I use:
hNewButton=copyobj(hPushButton,hGroup);
(later I change the position of the new button, so they don't overlap).
This works fine in R2014 , but under R2012 it fails with the error:
Error using copyobj
Invalid child handle argument
How do I fix it? (Alternatively, if there is an * bold * better way of cloning a button, please let me know).
  • edit: * I just noticed the 2012 version I'm using is 64 bits while the 2014 is 32, so I have asomewhat different question (hopefully there will be some answers now): is the a problem with copyobj in MATLAB 2012A 64 bits?

Réponses (1)

Sean de Wolski
Sean de Wolski le 30 Déc 2014

0 votes

In the release notes:
Go to:
MATLAB->Graphics->Compatibility Considerations->Copyobj
It explains the differences.

3 commentaires

Josh
Josh le 30 Déc 2014
Good to know, but it does not resolve the problem. What is wrong with the copyobj (or rather: what was wrong with it in R2012)?
Sean de Wolski
Sean de Wolski le 30 Déc 2014
Modifié(e) : Sean de Wolski le 30 Déc 2014
I don't know and without seeing working code, it's probably not reproducible. Use dbstop if error to stop when the error occurs in R2012a, it could be something in one of the callbacks that is no longer being copied.
Josh
Josh le 31 Déc 2014
Modifié(e) : Josh le 31 Déc 2014
The error occurs right when I issue the copyobj statement (and a debugger stop right before that statement shows both handles are good). BTW, the "is no longer being copied" pertains to R2014, which is the release that performs the copyobj with no problem. I wonder if anyone with R2012 is willing to try it (Have a group button, an embeded pushbutton, and try the copyobj as shown on my original question).

Connectez-vous pour commenter.

Catégories

En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange

Question posée :

le 24 Déc 2014

Modifié(e) :

le 31 Déc 2014

Community Treasure Hunt

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

Start Hunting!

Translated by