Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Detect close

Author
Message
Brandon Heat
15
Years of Service
User Offline
Joined: 28th Nov 2008
Location:
Posted: 15th Jan 2009 07:41 Edited at: 15th Jan 2009 07:43
Hey got a small problem i have a loop that continues untill you can no longer walk i.e hit a wall etc however this stuffs up if you close the window while walking.

Is there a way i can detect a window close, and have

while (can_walk && window.close == false) or something to that effect?
old man
20
Years of Service
User Offline
Joined: 25th Feb 2004
Location:
Posted: 15th Jan 2009 09:15
Hi Brandon

I had this problem and solved it by including

if(loopGDK()!=1){goto endnow;}

to take me past the end of the looping bit.

So while (can_walk && loopGDK()==1) may help.

uff
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 15th Jan 2009 20:35
Quote: "So while (can_walk && loopGDK()==1) may help."


Do you even need the check for equaling 1? I believe that the returned value is zero when GDK says it's ready to quit. So you could do

So while (can_walk && loopGDK())

A small bit of gain but I'm manic that way.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Brandon Heat
15
Years of Service
User Offline
Joined: 28th Nov 2008
Location:
Posted: 16th Jan 2009 00:38
Thanks for the help guys!

Login to post a reply

Server time is: 2024-09-30 15:35:47
Your offset time is: 2024-09-30 15:35:47