include "draw.m"; draw:= load Draw Draw->PATH; Screen: adt { id: int; image: ref Image; fill: ref Image; allocate: fn(image, fill: ref Image, public: int): ref Screen; newwindow:fn(screen: self ref Screen, r: Rect, color:int): ref Image; top: fn(screen: self ref Screen, wins: array of ref Image); };
allocate (image, fill, public)
The allocate function makes a new Screen object. The image argument provides the base image on which the windows will be made. The fill argument provides the Screen.fill image. Allocate does not affect the contents of image. It may be necessary after allocation to paint the base image with fill. screen.newwindow (r)
The newwindow function allocates a window on the display at the specified rectangle; the return value is an Image. screen.top (wins)
The top function organizes a group of windows on a screen. Given wins, an array of window images, it places the wins[0] element at the top, wins[1] behind that, and so on, with the last element of wins in front of all the windows on the screen not in wins. Images in the array must be on the specified screen (nil elements are ignored).