Jump to content

"save before closing" Dialog


photo

Recommended Posts

Hi there,

 

I'm currently trying to implement a Yes/No confirmation dialog that prompts the user to save before the application closes (after the user hits the cross in the top right to close the main window).

 

Problem is, every implementation I've tried in UnigineScript still allows the main window to be closed when the uses hits the cross on a second attempt - regardless whether the prompt dialog is open or not.

 

It seems that I'll have to "roll my own" solution to this in C++ - calling a native Windows system dialog to ensure the main Unigine window can't be closed until the user has pushed yes/no/cancel on the prompt window.

 

Is this the best solution or am I missing something?  Is there a way to prevent unigine from closing if a modal dialog is open?  I'm using Unigine 1.0  BTW.

 

Cheers,

Simon

Link to comment

Just to be clear - this is the process of operations I'm currently having to deal with:

 

1. User closes unigine app by clicking the 'X' in the top right

2. my app goes through and checks to see if any data needs saving

3. if so, tries to prompt the user with WidgetWindow (using setPermanentFocus)

4. that's asynchronous to unigine continues on and shuts down anyway.

 

so, once shutdown() is called there doesn't seem to be any way to pause the app shutdown unless I use a native windows dialog which will halt the app.

Link to comment
×
×
  • Create New...