function GOButtonPushed(app, event)
app.Lamp.Color = 'yellow';
% Some long computation.
app.Lamp.Color = 'green';
end
If I have the above code the lamp never turns yellow. It seems like the UI doensn't refresh until the entire callback finishes.
Is there a way to fix this?

 Respuesta aceptada

Rik
Rik el 2 de Abr. de 2019

0 votos

You can force a graphics update with drawnow, or by introducing a small pause (in general I see people using pause(0.01) or a similar amount of time). Either will flush the queue of graphics updates.

2 comentarios

Evan Bates
Evan Bates el 21 de Feb. de 2020
Is this still the solution? I have the same problem.
Rik
Rik el 21 de Feb. de 2020
I would expect so. Have you tried it?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.

Preguntada:

el 2 de Abr. de 2019

Comentada:

Rik
el 21 de Feb. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by