system.nav.openWindow, wait for window to close before finishing script?

I have a button if mouseClicked, i want it to open a window where i will input some data, the close button will write the data back to the custom properties of the button that initiated the opening the window. The script then would pass this data (along with some others that were already defined in custom properties) to a project script. The issue i am having is i am unsure of how to “pause” the script without blocking everything else in the process. I’ve looked into system.util.invokeLater but i can’t seem to piece it in to what i’m trying to do.

snoozeDuration = int(0)

system.nav.openWindow("getSnoozeDuration")

while(snoozeDuration == 0):
	snoozeDuration = event.source.snoozeDuration

alarms.snoozeButton(event)

You cannot. Pausing a component event script freezes the whole GUI. There is no equivalent to VB’s “doEvents” statement.

What you can do is stick a callable (function object) into a client property of the pop-up and have the popup look for it and run it on close. See this related topic:

1 Like