The routine gInsertSegRef() inserts a reference to segment nseg into the currently opened segment.
A reference may be made to a segment which does not yet exist, in which case the reference is ignored until the referenced segments are created and an operation is carried out on the segment, e.g. gMoveSegTo2D(), gMoveSegBy2D(), gDrawSeg(), gSetSegVis().
A referenced segment will inherit line and character attributes from its parent until specifically set within that segment. All current attributes are, however, saved at the beginning of a reference and restored once the referenced segment has been drawn.
A segment cannot reference itself but may reference another segment up to a depth of 10 references. GINO also checks for recursive references when a segment structure is traversed as long as it is holding a copy of the display file.
gInsertSegRef() may not operate on some devices when a hardware display file is available if this function is not provided. A call to gSetSegMode(GSOFTWARE) may therefore be required to force software emulation of hierarchical segment structures.