How do I use WinOnTop for GUIs?

3 ビュー (過去 30 日間)
CAM
CAM 2019 年 2 月 20 日
コメント済み: CAM 2019 年 9 月 30 日
I have a main GUI with an axes object on which I display an image. Occasionally, the users need to calibrate distances on the image (using imdistline). Since the calibration operation is not needed often, they have asked that the associated objects (text boxes, command buttons, etc) be on a separate "popup window". (i.e., They don't want the objects for calibration cluttering the main GUI).
I cannot use the modal WindowStyle for the calibration GUI, because it would not allow the user to interact with the image axis on the main GUI until the calibration GUI is closed.
I found WinOnTop in the MATLAB File Exchange, which keeps a figure window on top of other windows, while allowing user interaction with the other windows. However, I can't get it to work with a GUI. If I insert the command ( WInOnTop(handles.figName) ) in the calibration GUI's OpeningFcn, I get an error saying that I cannot apply WinOnTop until the figure is visible. I cannot insert it into the OutputFcn, because I need the calibration GUI to wait until the calibration procedures are done before returning the values back to the main GUI.
Am I overlooking something? Is there a better way to do this?
Thank you in advance for all of your help.

回答 (1 件)

weicheng Xu
weicheng Xu 2019 年 9 月 30 日
You an have a try like this
varargout{1} = handles.output;
WinOnTop(varargout{1});
But I don't need to return the value back.
  1 件のコメント
CAM
CAM 2019 年 9 月 30 日
Where would I put the code? In the calling script, OpeningFcn or in the OutputFcn?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by