I am not sure if I understand you right , but for dialogs I use onEvents usally. So every GUIEvent on this dialog (such as writing something into a textfield or pressing buttons) causes somehow a reaction which is handled by the EventReciever.
Of course, that was my first idea, but I was wondering if there is some better solution than setting some global var in the event handler and continuously checking if the window was closed to call the script again with the chosen value.
.
*confused* but with the Eventreciever you are not continously checking if the window is closed. The EnventReciever does something at that time, you press the button. meanwhile the Eventreciever does nothing.
I mean, the application, not the event receiver. I need some way to display the window from some lua or python script, choose an answer and send that value back to the script.