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.
WindowCLWShowCL. 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:
|
/* /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;
}
|
WindowExCLWindowExCL 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.
WShowCLWShowCL 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. |
WHideCLWShowCL but
the contents will have to be redrawn.
| void WHideCL ( |
WindowCT w); |
| w |
The identifier of the window to be hidden. |