Error when calling a PushButton programetically in Appdesigner
古いコメントを表示
I am trying to design a Pushbutton in Appdesigner, which when pushed it programetically pushes other buttons, which are present in the same gui. I have tried the following code:
% Button pushed function: SetZeroALLButton
function SetZeroALLButtonPushed(app, event)
ButtonPushed(app, matlab.ui.eventdata.SetZeroButton_5Data)
end
to push this button:
% Button pushed function: SetZeroButton_5
function SetZeroButton_5Pushed(app, event)
app.zero_weg_R = app.FederwegEditField_2.Value;
end
But it doesn't work. Any ideas why it is not working?
回答 (1 件)
Cris LaPierre
2021 年 11 月 10 日
Pushing a button just triggers the execution of a specific callback function. However, you can also call callback functions manually inside another callback function. Based on what you have shared, my callback function for the first pushbutton might look like this.
% Button pushed function: SetZeroALLButton
function SetZeroALLButtonPushed(app, event)
% run callback for SetZeroButton_5 button
app.SetZeroButton_5Pushed(event)
end
カテゴリ
ヘルプ センター および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!