# System.gui.confirm() - Auto close

**URL:** <https://forum.inductiveautomation.com/t/system-gui-confirm-auto-close/51725>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [October 7, 2021, 11:36pm UTC](https://forum.inductiveautomation.com/t/system-gui-confirm-auto-close/51725 "2021-10-07T23:36:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![BryanB](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BryanB](https://forum.inductiveautomation.com/u/BryanB)\
**Post date:** [October 7, 2021, 11:36pm UTC](https://forum.inductiveautomation.com/t/system-gui-confirm-auto-close/51725/1 "2021-10-07T23:36:20Z")

</div>

We're having reports that on one of our systems we're having an issue where a system.gui.confirm() popup is getting behind the Ignition display and silently locking out the screen. In order to be able to do anything we need to Alt-Tab to the confirm popup and close it.

Is there a way to automatically close/cancel system.gui.confirm() through scripting (for example, if they don't push yes within five minutes it automatically closes)?

This is Ignition 8.0.16 (Vision).

Thank you.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 8, 2021, 12:22am UTC](https://forum.inductiveautomation.com/t/system-gui-confirm-auto-close/51725/2 "2021-10-08T00:22:32Z")

</div>

You can’t use scripting because those popups stop the GUI thread. So almost all other scripts won’t run, either.

Just don’t use `system.gui.confirm()`. At all. (Nor any of the `system.gui.*Box` functions.) Make a real popup window for such user interaction. Use window z-order to keep them on top if necessary. Regular popup windows allow scripts to keep running, and can’t get behind the application window.

---

<div class="post-metadata">

**Author:** ![BryanB](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BryanB](https://forum.inductiveautomation.com/u/BryanB)\
**Post date:** [October 8, 2021, 12:40am UTC](https://forum.inductiveautomation.com/t/system-gui-confirm-auto-close/51725/3 "2021-10-08T00:40:58Z")

</div>

Good to know. This seems to be another of the “even though Ignition makes it an option, you shouldn’t ever do it” things. It would be nice if the documentation had these disclaimers included.

Appreciate the response, thanks!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 8, 2021, 2:15am UTC](https://forum.inductiveautomation.com/t/system-gui-confirm-auto-close/51725/4 "2021-10-08T02:15:42Z")

</div>

I would like to see them deprecated, so they drop out of the docs entirely.

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [October 8, 2021, 4:31am UTC](https://forum.inductiveautomation.com/t/system-gui-confirm-auto-close/51725/5 "2021-10-08T04:31:05Z")

</div>

Take a look at [this](https://forum.inductiveautomation.com/t/auto-close-error-box/12786/17)…

---

<div class="post-metadata">

**Author:** ![BryanB](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@BryanB](https://forum.inductiveautomation.com/u/BryanB)\
**Post date:** [October 8, 2021, 4:42am UTC](https://forum.inductiveautomation.com/t/system-gui-confirm-auto-close/51725/6 "2021-10-08T04:42:48Z")

</div>

Great reference, thanks.

---

<div class="post-metadata">

**Author:** ![awybenga](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@awybenga](https://forum.inductiveautomation.com/u/awybenga)\
**Post date:** [April 7, 2025, 4:37pm UTC](https://forum.inductiveautomation.com/t/system-gui-confirm-auto-close/51725/7 "2025-04-07T16:37:16Z")

</div>

> [@BryanB](#):
>
> aving an issue where a system.gui.confirm() popup is getting behind the Ignition display and silently locking out the screen. In order to be able to do anything we need to Al

Would you still recommend not using these popups? Both the confirm and the message boxes seem to open and occasionally loose focus and lock up ignition. Should we create pop up screens or have you learned a work around here? Thanks.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 7, 2025, 4:40pm UTC](https://forum.inductiveautomation.com/t/system-gui-confirm-auto-close/51725/8 "2025-04-07T16:40:22Z")

</div>

I avoid those modal popup functions entirely. Use actual popup windows and do not rely on a return value in the script that opens the popup.

For most effective re-use, I recommend placing function objects/lambas into the opened popup using Swing's `.putClientProperty()`, and have the popup's response buttons call those function objects.
