# Make a window pop-up after pressing a button for X seconds

**URL:** <https://forum.inductiveautomation.com/t/make-a-window-pop-up-after-pressing-a-button-for-x-seconds/72696>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [April 20, 2023, 11:10am UTC](https://forum.inductiveautomation.com/t/make-a-window-pop-up-after-pressing-a-button-for-x-seconds/72696 "2023-04-20T11:10:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eneko\_Suarez](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@Eneko\_Suarez](https://forum.inductiveautomation.com/u/Eneko_Suarez)\
**Post date:** [April 20, 2023, 11:10am UTC](https://forum.inductiveautomation.com/t/make-a-window-pop-up-after-pressing-a-button-for-x-seconds/72696/1 "2023-04-20T11:10:22Z")

</div>

We are designing a front on Ignition Vision and we would like to make the user press the button for X seconds to enter the settings window. How could we make it? 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 20, 2023, 11:44am UTC](https://forum.inductiveautomation.com/t/make-a-window-pop-up-after-pressing-a-button-for-x-seconds/72696/2 "2023-04-20T11:44:43Z")

</div>

I would use two components:

- An **unbound** momentary pushbutton component with the desired label/icon, and

- A timer component, set to the desired duration, with its Enable property bound to the control property of the momentary button. The timer component's action event would open the settings window.

---

<div class="post-metadata">

**Author:** ![Micah\_Gross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/micah_gross/32/46496_2.png) [@Micah\_Gross](https://forum.inductiveautomation.com/u/Micah_Gross)\
**Post date:** [April 26, 2023, 9:01pm UTC](https://forum.inductiveautomation.com/t/make-a-window-pop-up-after-pressing-a-button-for-x-seconds/72696/3 "2023-04-26T21:01:30Z")

</div>

Another way you could do it, using only one component, is to have a momentary pushbutton with the following script:  
def WaitFunction():  
if event.source.controlValue == 1:  
system.nav.swapTo('Test\_Settings')  
system.util.invokeLater(WaitFunction,5000)

 ![Hold_To_Open](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/9/99ba0ab0298305833e01f8ab44b9538565b13874.png)

This script fires when the button is pressed, then checks 5 seconds later to see if it is still pressed. One caveat for this method is that the button does not need to be pressed continuously (ie. you could press the button, release it for 3 seconds, then press and hold it until 5 seconds after the initial press.)

---

<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 26, 2023, 9:03pm UTC](https://forum.inductiveautomation.com/t/make-a-window-pop-up-after-pressing-a-button-for-x-seconds/72696/4 "2023-04-26T21:03:48Z")

</div>

> [@Micah\_Gross](#):
>
> One caveat

Pretty big caveat. Don't do it this way.
