waitbar not on top

조회 수: 2 (최근 30일)
Denis
Denis 2015년 7월 8일
댓글: Denis 2015년 7월 8일
Hi,
I have a code that has many computation steps, each with a waitbar that open and close. My problem is that it is not possible to work on other apps, like outlook or word, since the waitbar when created always appears on top and get the focus.
Is there a way to create the waitbar but do not change the window focus?
Best Regards,
Denis

답변 (1개)

Joseph Cheng
Joseph Cheng 2015년 7월 8일
In your implementation do you need to close and create a new waitbar? can you re-purpose the existing waitbar to encompass the other computation steps?
h = waitbar(0,'Please wait...');
steps = 1000;
for step = 1:steps
% computations take place here
waitbar(step/steps,h,['computing 1: ' num2str(step)])
end
for step = 1:steps
% computations take place here
waitbar(step/steps,h,['computing 2: ' num2str(step)])
end
for step = 1:steps
% computations take place here
waitbar(step/steps,h,['computing 3: ' num2str(step)])
end
close(h)
  댓글 수: 1
Denis
Denis 2015년 7월 8일
Thank you for your answer but unfortunately I cannot apply it to my specific case. Actually, the program is quite complex dans divided in subprogram that call subfunctions, a few calling waitbars, and a kind of batch launches several subprogam in series. Therefore, it is a bit tough to put a kind of global variable for the waitbar handle.
I wonder whether a waitbar property unknown from me may address my problem.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by