Treat windows or at least window identities as first class objects.

 Store window identities in variables, compare them for equality.
 Provide examples of performing some of the following:
 hide, 
 show, 
 close, 
 minimize, 
 maximize, 
 move,     and 
 resize a window. 


The window of interest may or may not have been created by your program.




link graphics
 
procedure main()
 
   Delay := 3000
 
   W1 := open("Window 1","g","resize=on","size=400,400","pos=100,100","bg=black","fg=red") |
         stop("Unable to open window 1")
   W2 := open("Window 2","g","resize=on","size=400,400","pos=450,450","bg=blue","fg=yellow") |
         stop("Unable to open window 2")
   W3 := open("Window 3","g","resize=on","size=400,400","pos=600,150","bg=orange","fg=black") |
         stop("Unable to open window 3")
   WWrite(W3,"Opened three windows")
 
   WWrite(W3,"Window 1&2 with rectangles")
   every Wx := W1 | W2 | W3 do
      if Wx ~=== W3 then 
         FillRectangle(Wx,50,50,100,100)     
 
   delay(Delay) 
   WWrite(W3,"Window 1 rasied")   
   Raise(W1)
 
   delay(Delay)
   WWrite(W3,"Window 2 hidden")   
   WAttrib(W2,"canvas=hidden")
 
   delay(Delay) 
   WWrite(W3,"Window 2 maximized")    
   WAttrib(W2,"canvas=maximal")
   Raise(W3)
 
   delay(Delay)   
   WWrite(W3,"Window 2 restored & resized") 
   WAttrib(W2,"canvas=normal")
   WAttrib(W2,"size=600,600")
 
   delay(Delay)
   WWrite(W3,"Window 2 moved")    
   WAttrib(W2,"posx=700","posy=300")
 
   delay(Delay) 
   WWrite(W3,"Window 2 minimized")     
   WAttrib(W2,"canvas=iconic")  
 
   delay(Delay) 
   WWrite(W3,"Window 2 restored")
   WAttrib(W2,"canvas=normal")  # restore as maximal, possible bug
 
   delay(Delay)
   WWrite(W3,"Enter Q or q here to quit") 
   WDone(W3)         
end