# Loading screen/gif during script execution

**URL:** <https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976>\
**Category:** Ignition\
**Tags:** ignition80, perspective, scripting\
**Created:** [July 20, 2021, 8:33am UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976 "2021-07-20T08:33:30Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [July 20, 2021, 8:33am UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/1 "2021-07-20T08:33:30Z")

</div>

Hi,

In my perspective project, I created som transform scripts in charts to get a lot of data from my DB. These actions can last between 5 to 10 seconds.  
Is it possible to show a loading screen or hourglass pointer to inform user that action is in progress ?

Thanks

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 20, 2021, 11:56am UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/2 "2021-07-20T11:56:47Z")

</div>

in style you can add:  
`cursor: wait` or `cursor: progress`  
((on windows10:) wait is the blue circle wait gif thingy and progress is the old pointer+hourglass)

and back to normal is  
`cursor: auto`

it only works when hovering that element tho or if you do it in the root it will work unless you hover a button/inputfield.  
It does not prevent clicks. If you want that aswell you can add in `pointer-events: none` But be sure to turn it back to auto, else you cant click anything anymore! `pointer-events: auto`

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [July 20, 2021, 12:30pm UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/3 "2021-07-20T12:30:45Z")

</div>

Thanks

It shows me a parse error for code below :  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/a/9a52163130817292e1fd3dc0d9aa068f1c775f8f.png)

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 20, 2021, 12:34pm UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/4 "2021-07-20T12:34:29Z")

</div>

you will need to use brackets around cursor and pointer-events  
like so  
`self.props.style['cursor']='wait'`

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 20, 2021, 3:45pm UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/5 "2021-07-20T15:45:04Z")

</div>

> [@victordcq](#):
>
> you will need to use brackets around cursor and pointer-events

Technically, just `pointer-events`, since that's not a valid Python identifier directly.

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [October 21, 2021, 7:54am UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/6 "2021-10-21T07:54:47Z")

</div>

Is there a way to disable root view and show a popup message during the script execution ?  
Changing cursor does not work fine for me.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [October 21, 2021, 8:08am UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/7 "2021-10-21T08:08:15Z")

</div>

What is not working about the cursor?

Showing a popup seems a bit exessive. Unless it really takes several minutes to execute your script…  
But you could open a popup and close it again in a script.  
if you set the popup to modal the user will only be able to interact with the popup (just dont put anything to close it on the popup so that the script is the only thing that can close it)

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [October 21, 2021, 9:22am UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/8 "2021-10-21T09:22:22Z")

</div>

It depends on the quantity of data. 1 - 10 seconds.

Cursor doesn’t work at all. The script do the opposite : cusror is waiting after the execution. 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [October 21, 2021, 9:32am UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/9 "2021-10-21T09:32:43Z")

</div>

did you set it to wait before it starts and back to ‘auto’ when its done ?xd

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [October 21, 2021, 11:00am UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/10 "2021-10-21T11:00:51Z")

</div>

I put it at the beginning and the end of the script yes.

It’s a script transform in chart series

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [October 21, 2021, 11:18am UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/11 "2021-10-21T11:18:35Z")

</div>

if its not turning back to normal you are probably doing something wrong xd could you show me the script?

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [October 21, 2021, 12:53pm UTC](https://forum.inductiveautomation.com/t/loading-screen-gif-during-script-execution/48976/12 "2021-10-21T12:53:32Z")

</div>

My script transform on TimesSeriesChart.series property.  
The component is on the root.

```auto
import system
	
self.parent.props.style.cursor="wait"
self.parent.props.style['pointer-events']="none"
	
try:
	start_datetime=system.date.fromMillis(int(self.view.params.start_datetime))
except:
	start_datetime=self.view.params.start_datetime
				
try:
	end_datetime=system.date.fromMillis(int(self.view.params.end_datetime))
except:
	end_datetime=self.view.params.end_datetime
		
inputs={
	'project_id':self.view.params.project_id,
	'device_id':self.view.params.device_id,
	'name':self.view.params.name,
	'start_datetime':start_datetime,
	'end_datetime':end_datetime,
	'overview':bool(value)
	}
	
	
result=campaign.generateChart(inputs)
	
if result['state']:
	series=result['outputs']
	if len(series) == 0 :
		self.props.title.visible=True
		self.meta.visible=False
	else:
		self.props.title.visible=False
		self.meta.visible=True
		
	self.parent.props.style.cursor="auto"
	self.parent.props.style['pointer-events']="auto"	
	return series
else:
	self.props.title.visible=False
	self.meta.visible=False
	self.parent.props.style.cursor="auto"
	self.parent.props.style['pointer-events']="auto"
	return []

```
