Error when calling a PushButton programetically in Appdesigner
Show older comments
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?
Answers (1)
Cris LaPierre
on 10 Nov 2021
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
1 Comment
Amr Elkhrachy
on 16 Nov 2021
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!