# \[SOLVED\] Is it possible to run system.gui.transform synchronously?

**URL:** <https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813>\
**Category:** Ignition\
**Created:** [September 17, 2020, 8:44pm UTC](https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813 "2020-09-17T20:44:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [September 17, 2020, 8:44pm UTC](https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813/1 "2020-09-17T20:44:52Z")

</div>

Good afternoon,

Is it possible to run system.gui.transform() synchronously? I want an animation to finish before I continue my script.

```
def myScript():
    ...do some stuf
    system.gui.transform(350 ms)
    ...do some other stuff

```

Thanks for any help.

---

<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:** [September 17, 2020, 8:51pm UTC](https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813/2 "2020-09-17T20:51:16Z")

</div>

You can pass a callback function into the transform and it will execute that once the transform is done

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [September 17, 2020, 8:54pm UTC](https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813/3 "2020-09-17T20:54:57Z")

</div>

```
button1 = event.source.parent.getComponent('someButton')
rectangle = event.source.parent.getComponent('Rectangle')

p_Duration = 15000
p_Callback = NUMS.helloWorld()
p_FPS = 60
p_Accel = system.gui.ACCL_CONSTANT
p_Coord = system.gui.COORD_DESIGNER

rectX = rectangle.relX
rectY = rectangle.relY
rectWidth = rectangle.relWidth
rectHeight = rectangle.relHeight

NUMS.transform_This(button1, rectX, rectY, rectWidth, rectHeight, 
								p_Duration, p_Callback, p_FPS, p_Accel, p_Coord)

```

I have the above on the action Performed script of a button called “Button”. My function helloWorld() gets executed long before the animation finishes…

```
def helloWorld():
    system.gui.messageBox('hello world')
```

---

<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:** [September 17, 2020, 8:57pm UTC](https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813/4 "2020-09-17T20:57:56Z")

</div>

You need to pass in the function definition. At the moment you’re executing the function and passing in its return value. Set `p_Callback = NUMS.helloWorld` instead

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [September 17, 2020, 9:03pm UTC](https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813/5 "2020-09-17T21:03:13Z")

</div>

I get the following error doing that.

```
NUMS.transform_This(button1, rectX, rectY, rectWidth, rectHeight, 
								p_Duration, p_Callback = NUMS.helloWorld, p_FPS, p_Accel, p_Coord)

```

Below:

```
Parse error for event handler "actionPerformed" SyntaxError: ('non-keyword arg after keyword arg', (' ', 16, 52, '\t\t\t\t\t\t\t\t\tp_Duration, p_Callback = NUMS.helloWorld, p_FPS, p_Accel, p_Coord)\n'))

```

The documentation says the callback function is a pyobject but i’m not sure what syntax that means for me.

---

<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:** [September 17, 2020, 9:04pm UTC](https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813/6 "2020-09-17T21:04:22Z")

</div>

I meant set it to that above where you’ve defined all your argument variables

 ![Screenshot_20200918-063443_Chrome](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/a/6afe829606d7c3a42a7049b2703377d2320db593.jpeg)

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [September 17, 2020, 9:04pm UTC](https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813/7 "2020-09-17T21:04:46Z")

</div>

Nevermind. See below code.

```
button1 = event.source.parent.getComponent('someButton')
rectangle = event.source.parent.getComponent('Rectangle')

p_Duration = 15000
p_Callback = NUMS.helloWorld
p_FPS = 60
p_Accel = system.gui.ACCL_CONSTANT
p_Coord = system.gui.COORD_DESIGNER

rectX = rectangle.relX
rectY = rectangle.relY
rectWidth = rectangle.relWidth
rectHeight = rectangle.relHeight

NUMS.transform_This(button1, rectX, rectY, rectWidth, rectHeight, 
								p_Duration, p_Callback, p_FPS, p_Accel, p_Coord)
```

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [September 17, 2020, 9:05pm UTC](https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813/8 "2020-09-17T21:05:18Z")

</div>

Got it. Thanks for the help.

---

<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:** [September 17, 2020, 9:06pm UTC](https://forum.inductiveautomation.com/t/solved-is-it-possible-to-run-system-gui-transform-synchronously/38813/9 "2020-09-17T21:06:11Z")

</div>

No worries, sorry if blunt, phone on 1% haha
