# Dynamically change size of a docked window on

**URL:** <https://forum.inductiveautomation.com/t/dynamically-change-size-of-a-docked-window-on/78206>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [August 22, 2023, 8:16am UTC](https://forum.inductiveautomation.com/t/dynamically-change-size-of-a-docked-window-on/78206 "2023-08-22T08:16:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henrol\_Jeo\_Gutierrez](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/henrol_jeo_gutierrez/32/50993_2.png) [@Henrol\_Jeo\_Gutierrez](https://forum.inductiveautomation.com/u/Henrol_Jeo_Gutierrez)\
**Post date:** [August 22, 2023, 8:16am UTC](https://forum.inductiveautomation.com/t/dynamically-change-size-of-a-docked-window-on/78206/1 "2023-08-22T08:16:36Z")

</div>

I have 2 docked windows, I wanna resize the 2nd window by pressing a button on my 1st window.  
I can easily do this by scripting "setSize" method, however I run into an error when I wan't my script to be more dynamic.

So here is my script on my button (under 1st window):

```auto
try:
	leftBarMenu = system.gui.getWindow('Left Bar Menu')
	leftBarMenu_width = leftBarMenu.getSize().getWidth()
	leftBarMenu_height = leftBarMenu.getSize().getHeight()
	leftBarMenu.setSize(100,leftBarMenu_height)
	
except ValueError:
	print "Error"

```

I wanna expand my 2nd window's width into 100 value and retain the existing height.  
However I have this error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/3/f367f0552340941871d50228f9e15d8934671d9a.png)

Which is I don't have any ideas why, anyone in the community experience the same?

Thanks and Regards.  
Joe

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [August 22, 2023, 9:30am UTC](https://forum.inductiveautomation.com/t/dynamically-change-size-of-a-docked-window-on/78206/2 "2023-08-22T09:30:48Z")

</div>

Try to add `print type(leftBarMenu_height)` to your exception handling and see what type is your variable.

---

<div class="post-metadata">

**Author:** ![Henrol\_Jeo\_Gutierrez](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/henrol_jeo_gutierrez/32/50993_2.png) [@Henrol\_Jeo\_Gutierrez](https://forum.inductiveautomation.com/u/Henrol_Jeo_Gutierrez)\
**Post date:** [August 22, 2023, 9:56am UTC](https://forum.inductiveautomation.com/t/dynamically-change-size-of-a-docked-window-on/78206/3 "2023-08-22T09:56:47Z")

</div>

Hi, changing the code to this solved the problem.

```auto
try:
	leftBarMenu = system.gui.getWindow('Left Bar Menu')
	leftBarMenu_width = leftBarMenu.getSize().getWidth()
	leftBarMenu_height = leftBarMenu.getSize().getHeight()
	
	width = 500
	height = int(leftBarMenu_height)
	leftBarMenu.setSize(width,height)
	print leftBarMenu_width , ' ' , leftBarMenu_height
except ValueError:
	print "Error"

```

I think @pascal.fragnoud is right, by just simply converting the type of my variable "leftBarMenu\_height" to int solved it.

Thanks and Regards
