      PROGRAM TWIMP1
C        a trivial Fortran wimp program which
C        makes 1 window with a message.
C        Stops when window close icon is clicked.
C
C        needs only the Wimp library
C
C        initialise the wimp
      CALL WPINIT('TWIMP1')
C        make the window
      CALL WPMKNW(800,320,0,100,720,160,0,0,'My window',IWHAN)
C        open the window
      CALL WPOPNW(IWHAN)
C        go into the wimp loop (without null calls)
      CALL WPLOOP(1)
C        that's all we can do here
      END
C
      SUBROUTINE WQPLOT(IWHAN,IX1,IY1,IX2,IY2)
C        here we just print out a message.
C        there is only 1 window, so we don't need to check it's handle
C        and we don't even need to check the area.
C
      CHARACTER MESG1*28, MESG2*24
C
C        get wimp version
      CALL WPVRSN(IVERS)
C        convert to message
      WRITE(MESG1,101)FLOAT(IVERS)/100.0
  101 FORMAT('Welcome to Wimp version',F5.2)
      CALL WPHNDL(ITH)
      WRITE(MESG2,102)ITH
  102 FORMAT('Job handle is ',Z8)
C        print messages
      CALL WPTEXT(0,-16,MESG1)
      CALL WPTEXT(0,-64,MESG2)
      CALL WPTEXT(0,-112,'Click over the close icon to stop the job')
      RETURN
      END
C
      SUBROUTINE WQCLSW(IWHAN)
C        when we're asked to close the window,
C        just shut down the job instead
      CALL WPQUIT
      RETURN
      END

