; CHAP3.ACT ; Chapter 3 program from ; _MUX=Window_Programming_ ; By Bill Kendrick, (c) NBS 1995 ; This program opens a connection, creates a window and draws some ; shapes in it. ; Include the MUX-Window routines ; Single machine: INCLUDE "MUXLESSW.ACT" ; MUX network: ;INCLUDE "MUXW.ACT" ; Waits for a key on the Application Client's console Proc WaitKey() Byte Key=764 Print("(Press a key)") Key=255 Do Until Key<255 Od Key=255 Return ; Displays stuff in a window on the Window Server Proc Main() Window win,win2 Stat Z ; Connect to Window Server and tell it who and what we are If Connect("CHAP3","Demo")=FAILURE Then PrintE("Can't connect to server!") Return Fi ; Create a window win=OpenWin(10,10,150,150,3,"CHAP3") If (win=NULL) Then PrintE("Can't create a window!") Return Fi DrawLine(win,1,1,50,50,BLACK,NORMAL) DrawRect(win,50,50,50,50,BLACK, NORMAL,CLEAR) DrawRect(win,100,100,50,50,BLACK, NORMAL,BLACK) DrawArc(win,50,50,50,50,BLACK, NORMAL,CLEAR) DrawArc(win,55,55,32,32,BLACK, NORMAL,BLACK) WaitKey() ; Close our window and say goodbye Z=CloseWin(win) Z=Disconnect() Return PROC CALLER() ; For RETURN catching... MAIN() RETURN