フィルターのクリア

Callback for menu option to execute a function?

3 ビュー (過去 30 日間)
Iman Alsharkawi
Iman Alsharkawi 2011 年 4 月 12 日
I need help understanding how to make a menu option call another function... The example below is the handle I've made for a menu item titled 'I am bored...' When the user clicks this, I want the function game.m to execute. Obviously the way I have it written below isn't working. Advice?
handles.help_menu_bored = ...
uimenu(handles.help_menu,'label','I am bored...','Separator','on','Callback',{@help_menu_bored,handles});
function help_menu_bored_Callback(hObject, eventdata, handles)
fifteen
The error I get is the following:
??? Undefined function or method 'help_menu_bored' for input arguments of type 'struct'.
??? Error while evaluating uimenu Callback
Thanks!

採用された回答

Walter Roberson
Walter Roberson 2011 年 4 月 12 日
@help_menu_bored_Callback not @help_menu_bored . MATLAB will not add the "_Callback", as nothing in MATLAB assumes any particular structure for callback names.

その他の回答 (1 件)

Iman Alsharkawi
Iman Alsharkawi 2011 年 4 月 12 日
Gosh I feel dumb! Thanks for the prompt reply =)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by