String of GUIDE-gui-button does not change immediately with command set(handles...'String'...)
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!