
-----------------------------------
deep
Sat May 28, 2005 2:38 pm

closing a screen after exit
-----------------------------------
how do u cloase the run window, after you exit the program?

-----------------------------------
MysticVegeta
Sat May 28, 2005 2:49 pm


-----------------------------------
first before you run the program, make a window
var win := Window.Open("graphics:300;300")

After you finish the code and where you want to exit, go something like this ->
...
exit
Window.Close(win)


-----------------------------------
deep
Sat May 28, 2005 3:42 pm


-----------------------------------
it says that the last statement
Window.Close(win) 
will not be executed

-----------------------------------
Cervantes
Sat May 28, 2005 4:02 pm


-----------------------------------
You need to exit your main loop and then close the window.


loop % (main)
    %code
    exit when condition
end loop
Window.Close (winID)


-----------------------------------
StarGateSG-1
Sat May 28, 2005 5:18 pm


-----------------------------------
That is an ok method I find but is kinda messy, I prefer to make window invisble after the program ends.

-----------------------------------
Cervantes
Sat May 28, 2005 5:25 pm


-----------------------------------
How's that any better?  Especially since the program is ending, you'd think you would want to close the window.

-----------------------------------
MysticVegeta
Sat May 28, 2005 5:41 pm


-----------------------------------
Window.Close(Window.GetActive)

This maybe :?

-----------------------------------
MysticVegeta
Sat May 28, 2005 5:43 pm


-----------------------------------
 then close the window.


I dont think that makes a difference, The loop can run even when the window is closed

-----------------------------------
Cervantes
Sat May 28, 2005 6:34 pm


-----------------------------------
 then close the window.


I dont think that makes a difference, The loop can run even when the window is closed
I know.  What are you talking about?  :eh:
We're talking about once the main loop has been exitted and the program is finishing.  Stargate said it's better to hide the window than close it, and I asked why.

-----------------------------------
MysticVegeta
Sat May 28, 2005 6:42 pm


-----------------------------------
I meant it could be
Window.Close(win)
exit


-----------------------------------
Cervantes
Sat May 28, 2005 7:08 pm


-----------------------------------
Oh, well, that would require an if statement.  Sometimes you need to use the if statement, but often the less bulky exit when is capable.

-----------------------------------
StarGateSG-1
Sun May 29, 2005 8:49 am


-----------------------------------
I said you hide it after the program is finished, so say you have a GUI in there, you would put it after the GUI exit when process event. or after and exit when. Once the window is finished if you hide it. it will be gone for good, no it doesn't stack of finished files. It works better than havign to open the window then close it.

-----------------------------------
Cervantes
Sun May 29, 2005 11:32 am


-----------------------------------

It works better than havign to open the window then close it.

:lol: What's wrong with opening a window?  There's not much you can do with the program if you don't!
It seems like closing a window would be better management then simply hiding it and letting it sit there forever and ever.

-----------------------------------
MysticVegeta
Sun May 29, 2005 12:10 pm


-----------------------------------
sit there forever and ever.
eh? thats funny!  :lol:  :lol:  :lol:  :lol:

-----------------------------------
axej
Sun May 29, 2005 12:46 pm


-----------------------------------

It works better than havign to open the window then close it.

:lol: What's wrong with opening a window?  There's not much you can do with the program if you don't!
It seems like closing a window would be better management then simply hiding it and letting it sit there forever and ever.
its true since in turing if the program finishes, then there is nothing the user can do with the window anymore.

-----------------------------------
StarGateSG-1
Sun May 29, 2005 4:45 pm


-----------------------------------
The only reason i do it my way is becasue it is faster than the other way, at school we did tests with it on different commands and made best on what commands are faster. I shoudl have said that earlier, I though I did.

-----------------------------------
MysticVegeta
Sun May 29, 2005 4:47 pm


-----------------------------------
This topic shoulda been left unreplied after the first couple of replies  :roll:

-----------------------------------
axej
Sun May 29, 2005 5:33 pm


-----------------------------------
and you care why???
