| Author | 
		Message | 
	
		 
		Masta_911
 
 
 
    
		 | 
		
		
			
				  Posted: Tue Jan 16, 2007 8:42 pm    Post subject: Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				| could someone tell me the code that will close turing output window | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
		 
		Sponsor Sponsor 
		 
  
		 | 
		
 | 
	
	 
		  | 
	
				 
		rdrake
 
  
 
    
		 | 
		
		
			
				  Posted: Tue Jan 16, 2007 8:54 pm    Post subject: RE:Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				| You can halt execution, but you cannot close the main window itself. | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Clayton
 
  
 
    
		 | 
		
		
			
				  Posted: Tue Jan 16, 2007 9:34 pm    Post subject: Re: Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				actually:
 
 
  
 
 
EDIT: Dan, "defWinID" should be grey, as it is a predefined constant for Turing. | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Masta_911
 
 
 
    
		 | 
		
		
			
				  Posted: Tue Jan 16, 2007 10:17 pm    Post subject: Re: Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				i got another problem now     
 
 
	  | code: | 	 		  
 
% Open the window
 
var winID : int
 
winID := Window.Open ("position:300;300,graphics:200;200")
 
 
% Draw the random ovals in the box
 
var x, y, clr : int
 
for : 1 .. 20
 
    x := Rand.Int (0, maxx)             % Random x
 
    y := Rand.Int (0, maxy)             % Random y
 
    clr := Rand.Int (0, maxcolor)           % Random color
 
    Draw.FillOval (x, y, 30, 30, clr)
 
end for
 
 
var ch : char := getchar                    % Wait for input
 
 
Window.Close (winID)                    % Close the window
 
  | 	  
 
 
heres the code i got from turing help and i wanted to know if there is a way to initialize 'winID' without having to use Window.Open command. | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Clayton
 
  
 
    
		 | 
		
		
			
				  Posted: Tue Jan 16, 2007 11:36 pm    Post subject: Re: Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				| "defWinID" is the default window ID for the run window that pops open whenever you output something. Simply call Window.Close() with defWinID as the argument, and the default run window will close. | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Masta_911
 
 
 
    
		 | 
		
		
			
				  Posted: Wed Jan 17, 2007 8:02 am    Post subject: RE:Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				if i use "defWinId" it gives me this error:
 
Close of standard stream -1 is not allowed | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		ericfourfour
 
 
 
    
		 | 
		
		
			
				  Posted: Wed Jan 17, 2007 3:27 pm    Post subject: RE:Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				You cannot close the default run window. You are allowed to hide to however.
 
 
Although, you can close windows other than the default one (but you got to open them first). | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Masta_911
 
 
 
    
		 | 
		
		
			
				  Posted: Wed Jan 17, 2007 4:29 pm    Post subject: RE:Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				ok thanks.. i wanted to make a quit button for my game and what is the best way to do it. i got the mouse module working all i need to know is how to close the window when i click on the quit button
 
 
could someone please help | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
		 
		Sponsor Sponsor 
		 
  
		 | 
		
 | 
	
	 
		  | 
	
				 
		Masta_911
 
 
 
    
		 | 
		
		
			
				  Posted: Wed Jan 17, 2007 8:54 pm    Post subject: RE:Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				can someone please help me with the quit button 
 
thanks | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		ericfourfour
 
 
 
    
		 | 
		
		
			
				  Posted: Wed Jan 17, 2007 9:09 pm    Post subject: RE:Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				I read it the first time. Please don't double post.
 
 
Make a function that returns true if the button has been pressed.
 
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Masta_911
 
 
 
    
		 | 
		
		
			
				  Posted: Wed Jan 17, 2007 9:26 pm    Post subject: Re: Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				i tried that but the it doesnt close it every time i click the button then it just flickers
 
heres the code
 
	  | code: | 	 		  
 
        if MouseInfo.X > 200 and MouseInfo.X < 600 and MouseInfo.Y > 212 and MouseInfo.Y < 261 then
 
            clos := true
 
        end if
 
        if clos = true then
 
            winID := Window.Open ("position:0;0,screen:max;max")
 
            Window.Close (winID)
 
        end if
 
  | 	 
  | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		ericfourfour
 
 
 
    
		 | 
		
		
			
				  Posted: Wed Jan 17, 2007 9:28 pm    Post subject: RE:Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				What are these two lines doing?
 
 
 | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Masta_911
 
 
 
    
		 | 
		
		
			
				  Posted: Wed Jan 17, 2007 9:32 pm    Post subject: RE:Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				| the first line initializes the winID variable|| dats the only way to initialize it as far as i know|| the second line is supposed to close the window which is not working at the moment | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		Clayton
 
  
 
    
		 | 
		
		
			
				  Posted: Wed Jan 17, 2007 10:32 pm    Post subject: Re: Close turing  | 
	
				
				 | 
			 
			 
				
  | 
			 
			
				| but that's not the window that you are outputting stuff to... the flicker is a new window opening and then closing.... you need to open the window at the start of your program, set to active, output done, then the window closed. | 
			 
			
				 | 
			 
		  | 
	
	 
		 | 
		
		 | 
	
	
 
		  | 
	
				 
		 |