# Creating new window with a script

**URL:** <https://forum.inductiveautomation.com/t/creating-new-window-with-a-script/13972>\
**Category:** Ignition\
**Created:** [April 3, 2017, 6:36am UTC](https://forum.inductiveautomation.com/t/creating-new-window-with-a-script/13972 "2017-04-03T06:36:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mmacerl](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmacerl/32/4024_2.png) [@Mmacerl](https://forum.inductiveautomation.com/u/Mmacerl)\
**Post date:** [April 3, 2017, 6:36am UTC](https://forum.inductiveautomation.com/t/creating-new-window-with-a-script/13972/1 "2017-04-03T06:36:48Z")

</div>

I would like to dynamically create a new window with a script. If someone can give me some advises how to achieve that. Thank you!

---

<div class="post-metadata">

**Author:** ![abishur](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/abishur/32/9096_2.png) [@abishur](https://forum.inductiveautomation.com/u/abishur)\
**Post date:** [April 3, 2017, 2:36pm UTC](https://forum.inductiveautomation.com/t/creating-new-window-with-a-script/13972/2 "2017-04-03T14:36:50Z")

</div>

Without knowing a lot more details about what all you’re trying to load on to the window, that’s a really hard to answer question! That said, I’d search around on how to use the paintable canvas. The details of its use go WAY beyond my understanding, but you can do a lot of cool things with it including dynamic creation of objects. So as a broad answer, you’d make a blank window, put the paintable canvas on it and then use scripts to tell it what you wanted to load dynamically.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [April 3, 2017, 3:43pm UTC](https://forum.inductiveautomation.com/t/creating-new-window-with-a-script/13972/3 "2017-04-03T15:43:33Z")

</div>

You can use the Template Canvas component to dynamically create windows at runtime. See my blog post here to find out how to do that: [nickmudge.info/post/ignitions-te … at-runtime](http://nickmudge.info/post/ignitions-template-canvas-dynamically-creating-screens-at-runtime)

Best,

---

<div class="post-metadata">

**Author:** ![Mmacerl](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmacerl/32/4024_2.png) [@Mmacerl](https://forum.inductiveautomation.com/u/Mmacerl)\
**Post date:** [April 4, 2017, 6:34am UTC](https://forum.inductiveautomation.com/t/creating-new-window-with-a-script/13972/4 "2017-04-04T06:34:10Z")

</div>

basically what I want to achieve is the same if you do a right click on Windows in project browser and click Main Window (in designer).  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/11f65b36113fdc7d604be3e1243a736088e1b360.png)  
  
But I want to achieve that in run time. Let’s say that I want a button on which I will click (in run time) and I will get a new Window instance in the designer.

---

<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 4, 2017, 12:14pm UTC](https://forum.inductiveautomation.com/t/creating-new-window-with-a-script/13972/5 "2017-04-04T12:14:30Z")

</div>

You really don’t want to go there. That would require manipulating Ignition’s deliberately undocumented and unsupported internal project resources. You wouldn’t be able to trust your code working through even a bugfix version update.

---

<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 4, 2017, 12:17pm UTC](https://forum.inductiveautomation.com/t/creating-new-window-with-a-script/13972/6 "2017-04-04T12:17:22Z")

</div>

If you desperately need this, you’ll want to start [here in the JavaDocs](http://files.inductiveautomation.com/sdk/javadoc/ignition79/790-beta1/com/inductiveautomation/factorypmi/application/FPMIWindow.html). Good luck, and don’t say you weren’t warned. /-:

---

<div class="post-metadata">

**Author:** ![abishur](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/abishur/32/9096_2.png) [@abishur](https://forum.inductiveautomation.com/u/abishur)\
**Post date:** [April 4, 2017, 1:26pm UTC](https://forum.inductiveautomation.com/t/creating-new-window-with-a-script/13972/7 "2017-04-04T13:26:54Z")

</div>

Just to really understand your end goal here, what are you desiring to accomplish after you create a new screen, like what are you wanting the screen to actually display?
