String of GUIDE-gui-button does not change immediately with command set(handles...'String'...)
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I've created a GUIDE-gui with a push-button and a buttongroup with two buttons.
On every selection-change in the buttongroup, the string of the push-button changes from "plot" to "LOAD". When pushing the button "LOAD", the selected database (40MB) will load. When pushing the same button but with string "PLOT", the new database will be plotted.
Cause of the 6-7 secconds Matlab needs to load the new database, I wanted the change the button-String before starting to load the new database to "WAIT". But this String "WAIT" will be shown after loading is complete and immediately after this, the string changes again to "PLOT".
Why doesn't change the string to "WAIT" before starting to load?
function btn_group_time_SelectionChangedFcn(hObject, eventdata, handles)
global ...
...
set(handles.btn_plot,'String','LOAD')
end
----
function btn_plot_Callback(hObject, eventdata, handles)
global ...
switch handles.btn_plot.String
case 'LOAD'
set(handles.btn_plot,'String','WAIT')
cla reset
z = load(filename_mat);
...
set(handles.btn_plot,'String','PLOT')
case 'PLOT'
...
Updating the handles right after "set(...String,WAIT)"
set(handles.btn_plot,'String','WAIT')
guidata(hObject,handles);
doesn't change anything...
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Characters and Strings 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!