wcreate/[6,7] wcreate(Name, Visible, Top, Left, Depth, Width, Go_away)Note : Display windows created by MacProlog environment do not have Go_away boxes, to distinguish them from edit (program) windows
wpcreate/8 wpcreate(Name, Visible, Syntax, Mode, Top, Left, Depth, Width)Will create a new program edit window. The syntax specifies how the code in the window is to be compiled (e.g. EDINBURGH, KSL, PROLOG++), the Mode corresponds to whether the window is Interpreted or Optimised
windows/2 windows(Type, Window_list)where Type refers to prog, disp, ctrl or grap, the list is returned in the variable Window_list
wtype/2 wtype(Window, Type)where Window is the name of a window and its type is returned in Type
wkill/1 wkill(Window) whide/1 whide(Window) wshow/1 wshow(Window) wvis/1 wvis(Window) wfront/1 wfront(Window)where Window is the name of a window. When a window is hidden, its contents are preserved in a buffer - and one can still read or write to it. When a window is killed, anything that it may contain is now lost.
mywin :- wcreate(win1, 1, 50, 60, 100, 200, 1), wpen(win1,yellow), wpaper(win1,magenta).
Figure 2: A window with a Go-Away button
wsize/5 wsize(Window, Top, Left, Depth, Width) wlen/2 wlen(Window, Length) wpen/2 wpen(Window, Colour) wpaper/2 wpaper(Window, Colour)where Window is the name of a window. In the wsize definition, other than the window name, all other arguments may be variables - in which case they will be instantiated to the current values for the named window. The Length variable refers to the length of text in the window. wpen is the foreground (text) and wpaper the background colour of the window. Colour can be white, black, red, blue, yellow, green, cyan, magenta
Another very useful and important command for windows management is the actdeact call :
actdeact(Window, Prog)
Prog(activate, Window) :- code for activation ... Prog(deactivate, Window) :- code for deactivation ... Prog(close, Window) :- code for closing ...