source: trunk/src/update_waitbar.m @ 501

Last change on this file since 501 was 477, checked in by sommeria, 9 years ago

various bugs repaired.

File size: 845 bytes
Line 
1%'update_waitbar': update the waitbar display, used for ACTION functions in the GUI 'series'
2%------------------------------------------------------------------
3%INPUT:
4% hwaitbar:  handles of the waitbar to update
5% advance_ratio: number between 0 and 1 representing the advancement of the calculation (loop index relative to the total length)
6
7function update_waitbar(hwaitbar,advance_ratio)
8
9set(hwaitbar,'Units','pixels')
10pos=get(hwaitbar,'Position');%read waitbar position in pixels
11set(hwaitbar,'Units','normalized')%set back to normalize(the waitbar scales with the GUI)
12CData=ones(floor(pos(4)),floor(pos(3)),3);
13CData(:,:,3)=0 ;% initial color yellow (rgb=[1 1 0])
14CData(:,1:floor(advance_ratio*size(CData,2)),2)=0; % advancement part in red (suppress the second color component green)
15set(hwaitbar,'CData',CData)
16drawnow
Note: See TracBrowser for help on using the repository browser.