From: pedro moreno on
Hello matlab's partners!
Well, the problem it's not easy, at least for me... I have a GUI with a lot of calculations, and i want to put a waitbar or a progressbar (getting from http://blinkdagger.com/matlab/matlab-gui-tutorial-progress-status-bar/), I dont care if one option or the other. This is the appearance for waitbar (similar for progressbar):

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
From: machatsk on
"pedro moreno" <pjmf17(a)hotmail.com> wrote in message <i3rim8$32b$1(a)fred.mathworks.com>...
> Hello matlab's partners!
> Well, the problem it's not easy, at least for me... I have a GUI with a lot of calculations, and i want to put a waitbar or a progressbar (getting from http://blinkdagger.com/matlab/matlab-gui-tutorial-progress-status-bar/), I dont care if one option or the other. This is the appearance for waitbar (similar for progressbar):
>
> 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
From: Jan Simon on
Dear Pedro,

> 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
From: pedro moreno on
Well, waitbar with for loop I just knew, but it's not easy, because calculation1, 2, ... this calculations aren't for loop, else secuencial operations (not loops). In this sence, like waitbar is a fake, because only show 5 states in my case (0%, 20%, 40%, 80% 100%), but with this, i want one target "user, dont click nothing, because matlab is processing". 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).
Well, if someone know the solution of this, please, I ask for it.... And I think that I can be a great help in the future for people they are beginning in this world.

Thanks in advance
Pedro Moreno
From: pedro moreno on
Maybe there is a solution:

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