How to execute a few callbacks (in order) from another callback in App Designer?

2 次查看(过去 30 天)
Hello,
I want to execute a few button-pushed callbacks inside a bigger button-pushed callback. But, I want them to be executed at spesific time (after some other computations are done) and in specific order. Here is a sample code to further explain my question.
properties (Access = public)
%my properties are defined here
end
methods (Access = private)
% Button pushed function: Function1
function Function1ButtonPushed(app, event)
%execute Function1 callbacks
end
% Button pushed function: Function2
function Function2ButtonPushed(app, event)
%execute Function2 callbacks
end
% Button pushed function: Function3
function Function3ButtonPushed(app, event)
%execute Function3 callbacks
end
% Button pushed function: Function4
function Function4ButtonPushed(app, event)
%Some computations here
%need to execute Function1 callbacks
%need to execute Function2 callbacks
%need to execute Function3 callbacks
end
  3 个评论
TADA
TADA 2019-5-16
Rik's idea should work,
a more elegant solution would be to put the functionality of the callbacks in separate private functions, and call those, that way, you don't need to pass the "dirty" event data which is very ui event specific and is not necessary for most functionalities either way.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by