find handle to uialert/uiconfirm windows/boxes
19 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a problem using the uialert/uiconfirm functionality.
The short version of my question is: is there a way to find uialert/uiconfirm windows/boxes and close them programmatically if they are no longer required? I don't want to close the underlying uifigure.
The long version:
I'm currently working on a program with a GUI (using the new appdesigner/ uifigure utilities) in order to control an instrument. The setup is as following:
The instrument takes commands through the serial interface from the matlab program and executes them. The instrument has 2 buttons: one which allows to user to stop the instrument in case of an emergency and another to continue the operation. When one of these buttons is pushed the instrument state flag changes (Hold = on/off);
The program on the other side sends commands to the instrument depending on the user input. Before sending a new command, it querries the instrument state flag in order to determine whether the istrument state is Hold = off and ready to execute the next command. In case the flag changed to Hold = on, the program uses the uialert/uiconfirm functionality to notify the user and block additional input through the gui.
Once the Hold = on flag was triggered, there are two ways to disable it; eigther by pressing the instrument button or using the uialert/uiconfirm option button. If the user desides to press the instrument button, which I can monitor using a timer function querring the instrument state flag, I have the uialert window to be removed. Unfortunatly these functions do not return a handle or any other identification property which I could use to close the alert window. Do you have any idea how to work around this problem?
Thank you for your time and help in advance!
2 个评论
回答(1 个)
Sean de Wolski
2020-4-22
编辑:Sean de Wolski
2021-9-10
EDIT September 2021:
In 21a you can dismiss and alert with:
Original:
I don't think it's possible to get a handle to and do what you're asking.
That being said, I question the usability of an app that has popups appearing and disappearing. I think there is probably a better way to lay this out. Perhaps with just a regular uiswitch with a corresponding uilamp showing if it's running.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Maintain or Transition figure-Based Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!