Error when calling a PushButton programetically in Appdesigner
Ältere Kommentare anzeigen
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?
Antworten (1)
Cris LaPierre
am 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 Kommentar
Amr Elkhrachy
am 16 Nov. 2021
Kategorien
Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!