# Loading cursor/bar for a button

**URL:** <https://forum.inductiveautomation.com/t/loading-cursor-bar-for-a-button/103227>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [March 4, 2025, 6:04pm UTC](https://forum.inductiveautomation.com/t/loading-cursor-bar-for-a-button/103227 "2025-03-04T18:04:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorothy.fanzhu](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@dorothy.fanzhu](https://forum.inductiveautomation.com/u/dorothy.fanzhu)\
**Post date:** [March 4, 2025, 6:04pm UTC](https://forum.inductiveautomation.com/t/loading-cursor-bar-for-a-button/103227/1 "2025-03-04T18:04:54Z")

</div>

Hi everyone!

I'm having trouble figuring out how to show that a script is running when I click on the button that runs the script. I was thinking to use the wait cursor since when I run the script the entire window freezes for a while.

The script is inside the action performed event handler of the button and sort of looks like this:

1. define function() [function modifies a really big SQL dataset which is why it takes so long]
2. call function()
3. assign values based on function return

If there's a better way for me to implement the script for the loader to work, please let me know! I'm new to ignition so I'm still learning about all the features it has and how to implement them.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 4, 2025, 6:06pm UTC](https://forum.inductiveautomation.com/t/loading-cursor-bar-for-a-button/103227/2 "2025-03-04T18:06:29Z")

</div>

This:

> [@Update GUI via Asynchronous thread](https://forum.inductiveautomation.com/t/update-gui-via-asynchronous-thread/9666):
>
> I’ve got a script I am experimenting with that can take a lot of time to execute, so I now use the system.util.invokeAsynchronous to run the script in a separate thread to keep the GUI from locking up. I am using the asynchronous thread to copy files from one place to another, and I would like to show the progress of the file copy with a progress bar. How would I go about this? I am importing a few python libraries to do this. import shutil def fileTransfer(): path = system.file.openFile() …

---

<div class="post-metadata">

**Author:** ![dorothy.fanzhu](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@dorothy.fanzhu](https://forum.inductiveautomation.com/u/dorothy.fanzhu)\
**Post date:** [March 4, 2025, 6:19pm UTC](https://forum.inductiveautomation.com/t/loading-cursor-bar-for-a-button/103227/3 "2025-03-04T18:19:44Z")

</div>

Thank you so much!
