# Changing component properties on another open window

**URL:** <https://forum.inductiveautomation.com/t/changing-component-properties-on-another-open-window/91114>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [May 30, 2024, 4:54am UTC](https://forum.inductiveautomation.com/t/changing-component-properties-on-another-open-window/91114 "2024-05-30T04:54:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leversole](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@leversole](https://forum.inductiveautomation.com/u/leversole)\
**Post date:** [May 30, 2024, 4:54am UTC](https://forum.inductiveautomation.com/t/changing-component-properties-on-another-open-window/91114/1 "2024-05-30T04:54:43Z")

</div>

I am trying to set a button property on another open window with the following...

```python
window = system.gui.getWindow('System/BottomMenu')
comp = window.rootContainer.getComponent("SpareButton1")
comp.getComponent("SpareButton1").visible = True

```

It is giving the following error...

```python
Traceback (most recent call last):
  File "<event:visionWindowOpened>", line 3, in <module>
TypeError: getComponent(): 1st arg can't be coerced to int

Ignition v8.1.21 (b2022092908)
Java: Azul Systems, Inc. 11.0.15

```

Thanks

---

<div class="post-metadata">

**Author:** ![leversole](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@leversole](https://forum.inductiveautomation.com/u/leversole)\
**Post date:** [May 30, 2024, 5:28am UTC](https://forum.inductiveautomation.com/t/changing-component-properties-on-another-open-window/91114/2 "2024-05-30T05:28:45Z")

</div>

This worked, not 100% sure why though...

```python
system.gui.getWindow("System/BottomMenu").rootContainer.getComponent("SpareButton1").visible = True

```

---

<div class="post-metadata">

**Author:** ![n.meluccio](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/n.meluccio/32/4858_2.png) [@n.meluccio](https://forum.inductiveautomation.com/u/n.meluccio)\
**Post date:** [May 30, 2024, 6:25am UTC](https://forum.inductiveautomation.com/t/changing-component-properties-on-another-open-window/91114/3 "2024-05-30T06:25:29Z")

</div>

> [@leversole](#):
>
> `.rootContainer.getComponent("SpareButton1").visible`

```python
window = system.gui.getWindow('System/BottomMenu')
comp = window.rootContainer.getComponent("SpareButton1")
comp.visible = True

```

You were calling the getComponent two times

N.

---

<div class="post-metadata">

**Author:** ![leversole](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@leversole](https://forum.inductiveautomation.com/u/leversole)\
**Post date:** [May 30, 2024, 12:06pm UTC](https://forum.inductiveautomation.com/t/changing-component-properties-on-another-open-window/91114/4 "2024-05-30T12:06:00Z")

</div>

Thanks! It was late and my eyes were crossing! 😆
