# How to auto move popup window by mouse action?

**URL:** <https://forum.inductiveautomation.com/t/how-to-auto-move-popup-window-by-mouse-action/9853>\
**Category:** Ignition\
**Created:** [March 28, 2015, 7:22am UTC](https://forum.inductiveautomation.com/t/how-to-auto-move-popup-window-by-mouse-action/9853 "2015-03-28T07:22:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![janlly](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@janlly](https://forum.inductiveautomation.com/u/janlly)\
**Post date:** [March 28, 2015, 7:22am UTC](https://forum.inductiveautomation.com/t/how-to-auto-move-popup-window-by-mouse-action/9853/1 "2015-03-28T07:22:05Z")

</div>

i can used function to get point x,Y:  
system.gui.convertPointToScreen(event.x, event.y, event)

but i don’t know how to set the popup window startinglocation value?

---

<div class="post-metadata">

**Author:** ![janlly](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@janlly](https://forum.inductiveautomation.com/u/janlly)\
**Post date:** [March 28, 2015, 10:23am UTC](https://forum.inductiveautomation.com/t/how-to-auto-move-popup-window-by-mouse-action/9853/2 "2015-03-28T10:23:44Z")

</div>

i had find the solution:

system.gui.openWindow(‘valve’)  
system.gui.getWindow(‘valve’).setLocation(int x,int y)

---

<div class="post-metadata">

**Author:** ![ematschke](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ematschke/32/7544_2.png) [@ematschke](https://forum.inductiveautomation.com/u/ematschke)\
**Post date:** [March 11, 2019, 6:26pm UTC](https://forum.inductiveautomation.com/t/how-to-auto-move-popup-window-by-mouse-action/9853/3 "2019-03-11T18:26:05Z")

</div>

I found this in the manual and copied it exactly into my MouseReleased event and it returns an error.  
coords = system.gui.convertPointToScreen(event.x, event.y, event)  
event.source.getComponent(‘A\_Label’).text = “x: %s y: %s” %(coords[0], coords[1])

The error is that getComponent cannot coerce the first argument to integer.  
Why can’t the text of a label not display an integer as text.  
I also tried toString but that didnt help

---

<div class="post-metadata">

**Author:** ![ematschke](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ematschke/32/7544_2.png) [@ematschke](https://forum.inductiveautomation.com/u/ematschke)\
**Post date:** [March 11, 2019, 7:46pm UTC](https://forum.inductiveautomation.com/t/how-to-auto-move-popup-window-by-mouse-action/9853/4 "2019-03-11T19:46:46Z")

</div>

I actually found what I was looking for. I wanted to open a popup window and send it the X, Y coordinates of where the button was pushed and position the popup instance close to where the button was pushed.  
I got it working with system.gui.convertPointToScreen, and system.gui.getWindow(‘name’).setLocation
