- In Project Browser, select the root of your view.
- In Perspective Property Editor scroll down to CUSTOM.
- Create a new custom property
startTime.- Create an expression binding on
startTimewith the expression,now(0). This will fire once when the popup opens and save the current timestamp in the custom property.
- Create an expression binding on
- Create a second tag,
timeout.- Add an expression binding,
(now(1000) - {this.custom.startTime}) > 5000
This will evaluate every 1000 ms and will returntruewhen the popup has been open for 5000 ms.
- Add an expression binding,
- Right-click on
custom.timeoutand select Edit Change Script. Add the script,
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
if currentValue.value:
system.perspective.closePopup("")
Tips:
now(0) → Runs once on load.
now() → Runs at the default scan rate - typically 1000 ms.
now(4321) → Runs every 4321 ms.