To create a called segment, you must:
The following figure shows an example of how to draw a box in a called segment.
#define INCL_GPISEGMENTS#define INCL_GPICONTROL
#include <os2.h>
void fncSEGS02(void){
POINTL ptl;
HPS hps;
LONG idNonChained = 2;
GpiSetDrawingMode(hps, DM_RETAIN);
/* Creates a non-chained segment. */
if (ATTR_ON == GpiQueryInitialSegmentAttrs(hps, ATTR_CHAINED))
GpiSetInitialSegmentAttrs(hps, ATTR_CHAINED, ATTR_OFF);
GpiOpenSegment(hps, idNonChained);
ptl.x = 100;
ptl.y = 100;
GpiMove(hps, &ptl);
ptl.x = 200;
ptl.y = 200;
GpiLine(hps, &ptl);
GpiCloseSegment(hps);
} /* fncSEGS02 */