# Question of Popup

**URL:** <https://forum.inductiveautomation.com/t/question-of-popup/44597>\
**Category:** Ignition\
**Tags:** scripting, ignition79\
**Created:** [March 17, 2021, 8:33pm UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597 "2021-03-17T20:33:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidsasso.15](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@davidsasso.15](https://forum.inductiveautomation.com/u/davidsasso.15)\
**Post date:** [March 17, 2021, 8:33pm UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/1 "2021-03-17T20:33:29Z")

</div>

I need to do a popup, like a reminder, for example system.gui.messageBox() or system.gui.confirm() or even for asking a password or text system.gui.passwordBox(). The problem is I have multiple main windows, and each window has their own popup request. I only have one display monitor and navigate to one window. Where all windows call the popup (NOT POPUP WINDOW) all popups show up at the active window. So I need to show each popup on his own main window, or just show the popup that corresponds with the active window.

How can I select the window in wich the popup has to show up?

Any comments would be very precciate.

DS.

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [March 17, 2021, 9:54pm UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/2 "2021-03-17T21:54:46Z")

</div>

First comment is having multiple main windows open at the same time is bad design methodology.

Second comment is you can set a Popup X/Y loc manually like here:

> [@Set popup location for y axis only?](http://forum.inductiveautomation.com/t/set-popup-location-for-y-axis-only/14201):
>
> Greetings… I would like to set the location of a popup to x=center and y=200. How to accomplish with script? The setLocation requires two args and I only want to set one. Cheers, Steve

---

<div class="post-metadata">

**Author:** ![davidsasso.15](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@davidsasso.15](https://forum.inductiveautomation.com/u/davidsasso.15)\
**Post date:** [March 17, 2021, 10:19pm UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/3 "2021-03-17T22:19:43Z")

</div>

They are not open at the same time, Just one is active on monitor, but from the other windows are executing on gateway I think. That’s why all popups appear. Is that a bad design methodology too? I’m new with ignition and I would like to keep improving.

Thanks for the second comment, I’ll try that!

---

<div class="post-metadata">

**Author:** ![davidsasso.15](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@davidsasso.15](https://forum.inductiveautomation.com/u/davidsasso.15)\
**Post date:** [March 17, 2021, 10:20pm UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/4 "2021-03-17T22:20:20Z")

</div>

I use swap window command btw

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [March 17, 2021, 10:22pm UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/5 "2021-03-17T22:22:37Z")

</div>

Using swapWindows closes the current one and opens the new one, so the other doesn’t execute on the Gateway - which is not bad design practice.

I don’t really understand your query then.

You have some docked windows (e.g. navigation) and one main window open at a time. Why won’t the popup open in the centre of the main window on your one monitor?

---

<div class="post-metadata">

**Author:** ![davidsasso.15](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@davidsasso.15](https://forum.inductiveautomation.com/u/davidsasso.15)\
**Post date:** [March 17, 2021, 10:55pm UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/6 "2021-03-17T22:55:23Z")

</div>

Excuse me, I’ll try to be more specific.

I have a _“Super main”_ window, from there I click a button and **swap** to another _“Machines main”_ window (Here you can see little data from each machine, lets say 4 machines). On this _“Machines main”_ window I click a button and swap to the _“Machine1”_ window. It can be machine 1 or machine 2, or 3 or 4, but each machine has his own window.

The popup message (_system.gui.messageBox(“Please Update Data”,“Reminder”)_) is showed depending on time, so It executes 5 minutes before ending an hour. 8:55am = Call Popup, 9:55 = Call Popup, and so on…

What is happening is that each _“Machine#”_ window has an element showing the time, and from each time element I’m making the function call. At the last 5 minutes All 4 Popups from my 4 “Machine1”, “Machine2”, etc. windows, are showing them **all on the Active Window.**

The idea was show a reminder on proper window, so if I have “Machine3” window open, popup from window _“Machine1”_ does not show up on window _“Machine3”_.

I’m thinking on set a conditional, on every time element, if _“thisWindow”_ is _“active”_, call popup, if not, do not even call it. or do something else.

Hope its explained

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [March 17, 2021, 11:01pm UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/7 "2021-03-17T23:01:17Z")

</div>

Thanks for the clarification.

First comment would be DRY … Don’t Repeat Yourself. If these are identical machines (1, 2, 3, 4, N), I would work on a template and have a template repeater on your “super main window”.

Second comment is where are you calling the popup timer script? From a timer component on each “main window” (respective to machine n)?

I would create a gateway timer script to run and if time is at your conditions, and yes you have a good idea; if that window (machine N) is open, then open the popup.

---

<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:** [March 17, 2021, 11:09pm UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/8 "2021-03-17T23:09:53Z")

</div>

Your probably do need a conditional to get the right message, but I would recommend you not use the system.gui.\* functions for this. Use a normal Ignition popup window. The system.gui.\* functions _ **halt the entire gui** _. They should never be used by a timer or tag change event–only events caused directly by an operator, so they can be dismissed immediately by that operator.

Personally, I avoid them like the plague.

---

<div class="post-metadata">

**Author:** ![davidsasso.15](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@davidsasso.15](https://forum.inductiveautomation.com/u/davidsasso.15)\
**Post date:** [March 17, 2021, 11:58pm UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/9 "2021-03-17T23:58:01Z")

</div>

You are right, it’s better to use a Popup Window from Ignition, I should change that before the project increases, then I’ll probably have problems on the future.

It depends on the project itself, meanwhile the extra condition could work.

The first info I got was the system library, so I used that…

Well, thank you a lot for your time and patience I really appreciate that!

Are here in the forum something like “points” to give?

---

<div class="post-metadata">

**Author:** ![davidsasso.15](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@davidsasso.15](https://forum.inductiveautomation.com/u/davidsasso.15)\
**Post date:** [March 18, 2021, 12:01am UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/10 "2021-03-18T00:01:42Z")

</div>

In fact, I was looking for information like this, to know the behavior of that object.  
Is there any resource from inductive like this that I can read?

Definitely I’ll move to Popup Windows for this situation.

Thanks a lot, really I appreciate your comments.

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [March 18, 2021, 12:38am UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/11 "2021-03-18T00:38:02Z")

</div>

Down beside reply there is the “like (heart icon)” button, you can like individual posts.

Or if you get a reply that completely solves your problem, there is another button “solution” which then shows the thread as “solved” but users can still add content to “solved” topics.

I also accept BitCoin. Jokes 🙂

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 18, 2021, 8:29am UTC](https://forum.inductiveautomation.com/t/question-of-popup/44597/12 "2021-03-18T08:29:33Z")

</div>

Just 1 bitcoin will suffice, we’re not greedy here 😄
