Callback Function of uimenu
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Merve Makbule Semizer
le 26 Avr 2020
Commenté : Merve Makbule Semizer
le 27 Avr 2020
I wrote the callback functions to undo and redo to activities, and I can use these functions for pushbuttons(undo and redo buttons). But when I use the same callback functions for menu items, I get an error:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/287854/image.jpeg)
How can I fix this?
0 commentaires
Réponse acceptée
Mehmed Saad
le 27 Avr 2020
Modifié(e) : Mehmed Saad
le 27 Avr 2020
when uimenu (undo redo) callback goes to undo or redo functions, the parent of the hObject is uimenu and not the figure itself. The parent of uimenu is figure. which means if you want to call figure, you have to write
hObject.Parent.Parent
so when you call
entries=hObject.Parent.UserData;
for uimenu, the parent is uimenu and not the figure while for buttons of redo and undo the parent is figure itself
the best option is change
hObject.Parent
with
handle
in your code
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!