How to display the waitbar in the main GUI window
9 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm using Matlab R2015b.
I developed a GUI that when pushing the button "Analyser" , it displays a progress bar in another figure (see screen shot below).
I want to display this progress bar in the main window (progress bar to be merged), maybe by displaying it in a button or in axes !?
Here is my code :
% --- Executes on button press in Apply_Correction.
function Analyser_Callback(hObject, eventdata, handles)
%% hObject handle to Apply_Correction (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Starting the waitbar
h1 = waitbar(0,'Wait please...');
hw = findobj(h1,'Type','Patch');
set(hw,'EdgeColor',[0 1 0], 'FaceColor', [0 1 0])
% Calculation Here
%%%%%% Code part 1 %%%%%%
waitbar(0.3,h1) %%% filling the progress bar %%%
%%%%%% Code part 2 %%%%%%
waitbar(0.6,h1) %%% filling the progress bar %%%
%%%%%% Code part 3 %%%%%%
waitbar(1,h1) %%% filling the progress bar %%%
close(h1)
end
0 个评论
回答(1 个)
Amit Dhakite
2023-2-17
Hi Mehdi,
As per my understanding, you want to display your loader/waitbar in your main gui window.
You can do that by adding an HTML UI component in your app. When you want to show that loader, you can edit the value of its HTMLSource and then the value will be displayed in the main gui window itself.
An implementation of an example is attached here. You can edit it according to your requirements.
For further information about HTML UI component, kindly refer to the following link: https://www.mathworks.com/help/matlab/ref/uihtml.html
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dialog Boxes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!