Appdesigner: Execute callback from m file

Hi - does anyone have any idea how callbacks in appdesigner can be executed from an m file? I could not find an obvious solution. Thanks Joshu

回答 (1 件)

dpb
dpb 2022 年 8 月 15 日

0 投票

What do you mean, specifically?
appdesigner calls a given callback function; that function can call anything, m-file or not; but the callback function itself has to be the specific one referenced to in the app.
You can't delete the callback function body automagically created when you define there to be a callback function and substitute a free-standing m-file function for it, if that is what you mean -- but you don't need to since you can immediately call whatever m-file that would be.

4 件のコメント

Joshua
Joshua 2022 年 8 月 15 日
Thanks for getting back to me. I meant if I have a callback function in appdesigner (e.g. Pushbutton(app, event). How would I execute Pushbutton from within an m-file that is called elsewhere in the app.
Hopefully this makes more sense.
dpb
dpb 2022 年 8 月 15 日
Like any other function syntactically, but there's got be some way to execute the code in which that calling line is in and, AFAIK that'll have got to be tied to some object callback property to get it called.
What end result are you trying to achieve by this?
dpb
dpb 2022 年 8 月 16 日
What you're looking for here is <Events-sending-and-responding-to-messages>. I've never explored doing such so know nothing specific about using them.
Joshua
Joshua 2022 年 8 月 16 日
thanks for your help - will look into this.

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

カテゴリ

ヘルプ センター および File ExchangeEnvironment and Settings についてさらに検索

質問済み:

2022 年 8 月 15 日

コメント済み:

2022 年 8 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by