MATLAB Answers

App Designer not changing Edit Field Value after button is pushed

154 views (last 30 days)
AdamG2013468
AdamG2013468 on 20 Jun 2019
Commented: Adam Danz on 20 Jun 2019
Using the callback below, I am trying to print text to a "status bar" (Edit Field Text) before the body of the function is reached to indicate that the App is "processing". At the end of the script, I am printing "STATUS: Complete" to indicate that the funcion is done running. The "STATUS: Complete" text has no trouble being displayed in the edit text field, but i can't get it to print the initial STATUS text.
My code is arranged like so:
function ButtonPushed(app, event)
app.StatusField.Value = 'STATUS: Processing...';
[body of function....]
app.StatusField.Value = 'STATUS: Complete';
end

  0 Comments

Sign in to comment.

Accepted Answer

Adam Danz
Adam Danz on 20 Jun 2019
Edited: Adam Danz on 20 Jun 2019
Try this
function ButtonPushed(app, event)
app.StatusField.Value = 'STATUS: Processing...';
drawnow() % <---- tell matlab to update now
[body of function....]
app.StatusField.Value = 'STATUS: Complete';
end

More Answers (0)

Sign in to answer this question.