h = waitbar(0,'Por favor espere...'); %point 1
...calcutation1
waitbar(0.1,h);
...calculation2
waitbar(0.2,h);
....several calculations and waitbar
waitbar(1,h);close(h);
Well, the problem is that waitbar is created, but only appears in point 1, the rest of time it's hidden in the taskbar. Anybody knows the way that waitbar is always on top? (waitbar windows in front of GUI)(user must be always reported on the processing...)
Thanks in advance!
Greetings
If you have a for loop in your calculations, you can update the waitbar as the for loop executes. For instance:
for a=1:number
x=waitbar(a/number, 'Message') % a will change, so waitbar will update
close(x)
end
You'll need to close the waitbar within the loop so you don't get one thousand waitbars on your taskbar.
Maxx
> Well, the problem is that waitbar is created, but only appears in point 1, the rest of time it's hidden in the taskbar.
Do you mean, the window is hidden behind other windows? Or did you apply a magic trick to minimize the window? Otherwise I have no idea, how the Window could move into the taskbar.
Kind regards, Jan
Thanks in advance
Pedro Moreno
set(h,'WindowStyle','modal')
But the problem is that this instruction generates several 'bong' error noises, and in the command window no errors are showed. Is very strange, I have no idea... ¿anybody has the solution of the mistery?
thx
> The only thing for this was perfect is that waitbar window is always visible for user, but it always hide in the second updated, 20% (the waitbar window is minimized in taskbar).
Again: This is really strange! There is no Matlab method to minimize a window to the taskbar. Therefore you obviously apply a Java or OS call to minimize the WAITBAR window. Keep the window visible is trivial then: Omit this call.
And it would be helpful for the community if you show us, how you minimize the window.
If I miss the point: why/how is the window minimized to the taskbar?
Kind regards, Jan
The bong will be given each time you move the cursor outside of the modal
window. It is a normal part of defining a window to be modal.
figure(h)
as h was the handle for your waitbar, before you update it.