Callback Function of uimenu

7 ビュー (過去 30 日間)
Merve Makbule Semizer
Merve Makbule Semizer 2020 年 4 月 26 日
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:
How can I fix this?

採用された回答

Mehmed Saad
Mehmed Saad 2020 年 4 月 27 日
編集済み: Mehmed Saad 2020 年 4 月 27 日
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
  1 件のコメント
Merve Makbule Semizer
Merve Makbule Semizer 2020 年 4 月 27 日
Thank you so much

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by