Explicit ClearWin window creation

In this section:

When ClearWin+ creates a ClearWin window for you it is created full screen by default. Also, the window uses the Windows system fixed font (referred to as SYSTEM_FIXED_FONT in the Windows documentation). In general, it is better to create a ClearWin window explicitly so that you have a handle to it and you can exert more control. For example, the following would create a half-size window in the centre of the screen:

  WINAPP
  INCLUDE <windows.ins>
  INTEGER(7) win
  INTEGER xsize,ysize,xpos,ypos
  xsize=clearwin_info@('screen_width')/2
  ysize=clearwin_info@('screen_depth')/2
  xpos=xsize/4
  ypos=ysize/4
  win=create_window@('Moon landing',xpos,ypos,xsize,ysize)
  ...

The first ClearWin window that you create will be the parent window. When this window is closed the program will terminate.

Once you have created it, you can inform the system that your window is the default ClearWin window, thus:

  CALL set_default_window@(win)

A ClearWin window can also be attached to a specified Fortran unit, for example:

  CALL open_to_window@(7,win)
  WRITE(7,'(a)') 'Testing'

Fortran units connected to ClearWin windows are opened for input and output. When you close such a unit, the corresponding window is closed and all the heap storage required to hold the output is returned to the system.

When your program terminates, the ClearWin windows that it has created will remain open for viewing, scrolling etc. until closed by the user (e.g. by pressing Alt-F4).

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited