    /*  Insert a 'rexxarplib' window  */
    
    /* Make the required libraries active */    
    if ~show('l', "rexxarplib.library") then do
     check = addlib('rexxsupport.library',0,-30,0) 
     check = addlib('rexxarplib.library',0,-30,0)   
     end
    
    address AREXX '"call CreateHost(HOST, PORT)"'    
    if ~show('Ports','HOST') then address command 'WaitForPort HOST' 
    
    flags = 'BORDERLESS+BACKFILL'
    call OpenWindow(HOST,200,40,300,50,'MOUSEBUTTONS', flags) 
    call openport(PORT) ; call ActivateWindow(HOST)
    call SetReqColor(HOST,BACKGROUND,2) ; call BackFill(HOST)
    
    /* A triangle */
    call SetAPen(HOST,3) 
    call Move(HOST,60,40) ; call Draw(HOST,160,40)
    call Draw(HOST,100,4) ; call Draw(HOST,60,40)
    /* Embossed Text */
    call SetFont(HOST,'diamond.font',20,0)  
    call SetDrMd(HOST,JAM1)
    t = 'A N  I N S E T' ; call pat(30,30,t,1)
    call pat(26,32,t,1) ;  call pat(28,31,t,2)
      
    call waitpkt(PORT) ; p = getpkt(PORT)
    if p ~== NULL() then                 
      do                                  
        i = getarg(p) ;  t = reply(p, 0)
        if  i = 'MOUSEBUTTONS' then do       
          call CloseWindow(HOST)        /* Omit this line if you do not */
                                        /* wish to delete the insertion */
          exit
          end
     end
    end            
    exit
        
    pat:
     parse arg row, col, text, rgb
     call SetAPen(HOST,rgb) ; call Move(HOST,row,col) ; call Text(HOST,text)
    return
    /*            End of 'macro insert'          */
