String of GUIDE-gui-button does not change immediately with command set(handles...'String'...)
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!