# propertyChange event when window change it size

**URL:** <https://forum.inductiveautomation.com/t/propertychange-event-when-window-change-it-size/11369>\
**Category:** Ignition\
**Created:** [March 16, 2016, 5:04am UTC](https://forum.inductiveautomation.com/t/propertychange-event-when-window-change-it-size/11369 "2016-03-16T05:04:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![falko](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@falko](https://forum.inductiveautomation.com/u/falko)\
**Post date:** [March 16, 2016, 5:04am UTC](https://forum.inductiveautomation.com/t/propertychange-event-when-window-change-it-size/11369/1 "2016-03-16T05:04:06Z")

</div>

Hi all,

I’m trying to trigger some script (propertyChange) when main window change size.  
My problem is to find the name of window property that changed.  
There is property “Size”, but it do not work when I try to filter event ( if event.propertyName == “size” ).  
I know that property “Size” is not numeric type, and I am wondering is it possible to fire propertyChange event when window change it size?

Any help/examples would be greatly appreciated.

Cheers  
falko

---

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [March 16, 2016, 11:20pm UTC](https://forum.inductiveautomation.com/t/propertychange-event-when-window-change-it-size/11369/2 "2016-03-16T23:20:46Z")

</div>

Try this script and see if you can find the property:

```auto
print "Property::" + event.propertyName + " | " + str(event.oldValue) + " => " + str(event.newValue)
```

---

<div class="post-metadata">

**Author:** ![falko](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@falko](https://forum.inductiveautomation.com/u/falko)\
**Post date:** [March 17, 2016, 4:49am UTC](https://forum.inductiveautomation.com/t/propertychange-event-when-window-change-it-size/11369/3 "2016-03-17T04:49:50Z")

</div>

I tried that code, but it will give me Property::size, only when I activate script with window.size = (width, height).

To be precise, I am looking for some trigger which will activate certain script when ignition window is stretch or shrink (for example Resize the window using mouse drag)

---

<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:** [March 17, 2016, 2:49pm UTC](https://forum.inductiveautomation.com/t/propertychange-event-when-window-change-it-size/11369/4 "2016-03-17T14:49:42Z")

</div>

Add a component listener to the window:  
[stackoverflow.com/questions/2303 … size-event](http://stackoverflow.com/questions/2303305/window-resize-event)  
[docs.oracle.com/javase/tutorial/ … tener.html](http://docs.oracle.com/javase/tutorial/uiswing/events/componentlistener.html)

Best,

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [March 17, 2016, 8:13pm UTC](https://forum.inductiveautomation.com/t/propertychange-event-when-window-change-it-size/11369/5 "2016-03-17T20:13:20Z")

</div>

Hi nick,  
Do you think ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:") we can use these listener to prevent a popup windows to be dragged outside the visible screen boundary ?  
We dont like when the main windows is resized when a popup windows is dragged outside the down of the ignition main windows…

---

<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:** [March 17, 2016, 9:24pm UTC](https://forum.inductiveautomation.com/t/propertychange-event-when-window-change-it-size/11369/6 "2016-03-17T21:24:45Z")

</div>

Hi,  
Yes, I think something like that could be done to prevent the popup from being moved outside the visible screen boundary.

Best,
