Slick Forums

Discuss the Slick 2D Library
It is currently Sat May 25, 2013 3:54 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Feb 12, 2010 7:22 am 
Offline
Regular

Joined: Sun Oct 05, 2008 9:24 pm
Posts: 173
Is there a way to detect when slick gets a close event? For example, say a user clicks the top right X in windows. How can I "do some stuff" before allowing slick to exit?

Mainly I just want to clean up some database connections and gracefully flush/close some files.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 12, 2010 8:04 am 
Offline
Regular

Joined: Sun Dec 07, 2008 5:22 am
Posts: 238
Location: Vancouver, BC, Canada
Not sure but I think you should be able to just override closeRequested() in your Game class.

_________________
If at first quads don't succeed tri tri again.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 12, 2010 12:21 pm 
Offline
Regular

Joined: Sun Oct 05, 2008 9:24 pm
Posts: 173
That worked, thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group