| Description |
This m-file allows to specify a waitbar on a figure where the user wants to display it. The sample usage of waitbar_new is as given.
function test
h = dialog('Units', 'Pixels', 'Position', [20 20 360 100],'visible','off');
h1 = uicontrol('Parent',h,'Units', 'Pixels', 'Position', [10 70 75 25],'String','Test','Callback',@test_button);
movegui(h,'center');
set(h,'visible','on');
function test_button(hObject,eventdata)
wh=waitbar_new(0, gcf, 'r', [10 30 300 14]);
%wh=waitbar_new(0, gcf, [0.8 .5 1]);
%wh=waitbar_new(0, gcf);
for i=1:10000
waitbar_new(i/10000);
end
delete(wh); |