Radio button value does not update state

1 visualización (últimos 30 días)
Cristian
Cristian el 17 de Jul. de 2020
Comentada: Cristian el 17 de Jul. de 2020
Hi, i am having some problems working with matlab gui using the pushbutton and radio button controls. I am using a while cicle inside a pushbutton callback, and i realized that the sentence "handles.radiobutton1.Value" (radiobutton1 is ok) does not update the radio button value until the while cicle is finish. I mean, i change the radio button state from GUI and its value is just update when the while cicle is finish.
In the pushbutton property inspector the INTERRUPTIBLE option is ON.
Thanks in advanced

Respuesta aceptada

Image Analyst
Image Analyst el 17 de Jul. de 2020
Call drawnow as soon as you set the state of the radio button:
while whatever
% other code
% Now change the radio button value:
handles.radiobutton1.Value = newValue;
drawnow; % Force display to refresh immediately.
% other code;
end
  1 comentario
Cristian
Cristian el 17 de Jul. de 2020
it worked :)
actually i am reading the radio button state inside a cicle, but it also solve this trouble.
thanks for your help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre App Building en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by