Computer Science Canada Window.Close |
Author: | YasserSalama [ Tue Jun 03, 2008 12:42 pm ] | ||
Post subject: | Window.Close | ||
I have a program where it starts out by giving you two options; start and quit. I used the Window.Close command to get the quit button to work, but all it does is make the program finish and the window to minimize. I want to make it so it totally closes the window. Any help would be appreciated. P.S. You can take out the music file because it won't let the program work if you don't have the file.
|
Author: | SNIPERDUDE [ Tue Jun 03, 2008 1:54 pm ] |
Post subject: | RE:Window.Close |
when you compile it, isn't there an option to close the programme once it is finished? When you run it from turing it will only minimize it, but when you compile it should ask you if you want to leave it open once done or not. Hope that helps. |
Author: | jeffgreco13 [ Tue Jun 03, 2008 2:04 pm ] | ||
Post subject: | Re: Window.Close | ||
Almost positive this is your problem. winID is an empty variable.
You place that code at the top. You don't really need that "View.Set" if you set your parameters properly. Check out the Turing documentation on exactly how to setup the Window.Open() command. That should make the window itself have an ID of "winID" so when you call the Window.Close(winID) it will close the main window. Check it out let us know. EVERYTHING ANSWERED BY GOOD OL' COMPSCI.CA http://compsci.ca/v3/printview.php?t=8901&start=0 |
Author: | Sean [ Tue Jun 03, 2008 2:21 pm ] | ||
Post subject: | Re: Window.Close | ||
The above is correct. You made a window variable, but never gave it paramters. That is why nothing happened.
|
Author: | YasserSalama [ Wed Jun 04, 2008 11:57 am ] |
Post subject: | RE:Window.Close |
Thanks for the help but when I declare the variable winID with parameters, then when I hit quit, the window goes back to the default window (small size, button bar, etc.) I want it to just close totally. |
Author: | YasserSalama [ Wed Jun 04, 2008 12:02 pm ] |
Post subject: | RE:Window.Close |
Oh. I tried putting in two Window.Close commands and it seemed to work. Thanks for the help guys! |
Author: | gitoxa [ Wed Jun 04, 2008 12:28 pm ] |
Post subject: | RE:Window.Close |
Part of the problem might be that your progra mnever actually ends. It's forever in the main loop until forcefully shut down. |
Author: | Sean [ Wed Jun 04, 2008 12:49 pm ] | ||
Post subject: | Re: Window.Close | ||
The reason that it opens a second window, is because you aren't sending your output to your created window. Before you do anything in your procedures, use: Window.Select (WinID)
|