uistack figure simulator top

조회 수: 3 (최근 30일)
john
john 2014년 3월 20일
댓글: john 2014년 3월 24일
Hello,
software ( main figure) in gui has name Simulator. If I have opened two and more figures, and I use
set(0,'CurrentFigure',findobj('type','figure','name','Simulator'))
f=gcf
uistack(f, 'top')
than Simulator is on the top. But if there is opened only Simulator, and I use above code, than appears main Matlba Window on the top.
How can I do, that Simulator will be always on the top?
Thank you
  댓글 수: 1
john
john 2014년 3월 23일
I solved it by this code:
set(0,'CurrentFigure',findobj('type','figure','name','Simulator'))
f=gcf;
uistack(f,'top');
figure(f);
set(0,'CurrentFigure',f);
uistack(f,'top');

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

채택된 답변

Jan
Jan 2014년 3월 23일
편집: Jan 2014년 3월 23일
According to the documentation, this should be sufficient already:
FigH = findobj(allchild(0), 'flat', 'name', 'Simulator');
figure(FigH);
  댓글 수: 3
john
john 2014년 3월 23일
For example, I have two figures, one is main.
If main is top, and I use
uistack(FigH,'top');
than second figure I show for realy short time, after that, main figure is in the top.....why there is switching between figures? if main is on the top?
john
john 2014년 3월 24일
code:
FigH = findobj(allchild(0), 'flat', 'name', 'Simulator');
figure(FigH);
uistack(FigH,'top');
sometimes doesn't work, sometimes main figure is not on top...:-O

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by