PDA

View Full Version : Calling close in onInit == crash



Toadwart
February 22nd, 2008, 21:55
Is it possible for a windowclass to open perform some functions then close itself?

Tried just calling close() at the end of the onInit function but it causes FG to crash.

Also tried adding a genericcontrol with an onHover function and calling window.Close() in there (so the window closes itself as soon as the user moves the mouse over it)
While that does work it seems to cause a crash when I exit FG.

joshuha
February 22nd, 2008, 23:56
Is it possible for a windowclass to open perform some functions then close itself?

Tried just calling close() at the end of the onInit function but it causes FG to crash.

Also tried adding a genericcontrol with an onHover function and calling window.Close() in there (so the window closes itself as soon as the user moves the mouse over it)
While that does work it seems to cause a crash when I exit FG.

Is there a reason you would want to open up another windowclass but have it close immediately? Wouldn't the functionality you want to do be accomplished with a function from where you were calling this windowclass.

What I guess is happening is the onInit is really fired just as its initializing and you close the control it has issue finishing the handling of that which causes the crash.