; CHAP2.ACT ; Chapter 2 program from ; _MUX=Window_Programming_ ; By Bill Kendrick, (c) NBS 1995 ; This program opens a connection and opens two ; windows. ; 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 PrintE("(Press a key)") Key=255 Do Until Key<255 Od Key=255 Return ; Connect and open a window Proc Main() Stat Z Window win,win2 ; Connect to Window Server and tell it who and what we are If Connect("CHAP2","Demo")=FAILURE Then PrintE("Can't connect to server!") Return Fi ; (We'll wait for a keypress between ; each change) ; Open the first two windows win=OpenWin(30,30,40,20,3,"Window!") WaitKey() win2=OpenWin(34,34,60,20,3,"Another") WaitKey() ; Reraise the 1st window RaiseWin(win) WaitKey() ; Now close it CloseWin(win) WaitKey() ; Open up a 3rd window win=OpenWin(60,3,30,30,6,"Uhhh") WaitKey() ; Reraise the 2nd RaiseWin(win2) WaitKey() ; Now close 1st window and 3rd window CloseWin(win) WaitKey() CloseWin(win2) ; Wait before exiting... WaitKey() Disconnect() Return PROC CALLER() ; For RETURN catching... MAIN() RETURN