String of GUIDE-gui-button does not change immediately with command set(handle​s...'Strin​g'...)

1 view (last 30 days)
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...

Accepted Answer

ES
ES on 28 Aug 2017

More Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!