next up previous contents index
Next: Writing in a window Up: Using CCATSL Windows Previous: Using CCATSL Windows   Contents   Index


Basic CCATSL window routines

CCATSL windows are created with WindowCL, or WindowExCL, but they must also be opened (made visible) with WShowCL before they can be used. Some other useful functions are WClearCL, which clears the window, WHideCL, which makes the window disappear (it can be restored with another call to WShowCL but the contents will need to be redrawn), and WCurrentCL which changes the window in which CCATSL graphics appear.


WindowCL

This routine creates a new CCATSL window. The window will not be visible until after a call to WShowCL. A more general window creation routine is WindowExCL.

  WindowCT WindowCL ( double left,
  double bottom,
  double right,
  double top);

  left, bottom, right, top The initial location of the of bottom-left and top-right corners of the window relative to the bottom-left corner of the main CCATSL window, and expressed as proportions of the width and height of the main CCATSL window.

The return value is the id of the new window. Many of the example programs serve as illustrations of WindowCL but a minimal example might look like:


screenshot of newwin.pas
  
/*   /examples/chapter4/newwin.c  */
#include <catam.h>
int MainCL(void)
{
  WindowCT w;
  w=WindowCL(0.1,0.1,0.9,0.9);
  WShowCL(w);
  WTitleCL("A simple window");
  return 0;
}


WindowExCL

WindowExCL is a more general procedure for creating windows than WindowCL.

  WindowCT WindowExCL ( double left,
  double bottom,
  double right,
  double top,
  ColourCT tcol,
  ColourCT bgcol,
  ColourCT gcol,
  WindowTypeCT wtype,
  int pw,
  int ph);

  left, bottom, right, top The initial location of the of bottom-left and top-right corners of the window relative to the bottom-left corner of the main CCATSL window, and expressed as proportions of the width and height of the main CCATSL window.
  tcol, bgcol, gcol tcol and bgcol specify the text colour and the background colour for the window. gcol sets the initial graphics line colour
  wtype The window type. See here for details.
  pw,ph The width and height of the `bitmap', which may be larger than the actual window. This is only relevant if wtype=SCROLLINGWIN.

The return value is the id of the new window.


WShowCL

WShowCL makes a window previously created with WindowCL, or WindowExCL, or closed with WHideCL, visible again.

  void WShowCL ( WindowCT w);

  w The identifier of the window to be opened.


WHideCL

This routine makes a given window disappear. The window can be made visible again using WShowCL but the contents will have to be redrawn.

  void WHideCL ( WindowCT w);

  w The identifier of the window to be hidden.


next up previous contents index
Next: Writing in a window Up: Using CCATSL Windows Previous: Using CCATSL Windows   Contents   Index
CATAM admin 2010-02-23