Page 1 of 1

Returning a value from a window

Posted: Wed Apr 28, 2004 12:26 pm
by rogerdv
I need to create a dialog window for my rpg, but I dont know how to return the choosen option back to program. Can somebody suggest me an idea?

Posted: Wed Apr 28, 2004 12:41 pm
by Guest
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.

Posted: Wed Apr 28, 2004 1:29 pm
by rogerdv
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.
.

Posted: Wed Apr 28, 2004 1:38 pm
by Guest
*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.

Posted: Wed Apr 28, 2004 1:43 pm
by rogerdv
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.