next up previous contents index
Next: 2. Layout Management Functions Up: 4. The GeoUtils Functions Previous: 4. The GeoUtils Functions   Contents   Index

1. The Allocation, Initialization, and Deallocation Functions

First, let's talk about the functions used when you want to allocate a GeoMatrix (i.e., the widget method known as geo_matrix_create()). In that method, you have to compute the number of rows of children that you are going to layout, and the number of children (total) involved (more on this when we actually examine a subclass).

The first function, which is actually called from subclass code, takes the information you've gathered about your children, and allocates the GeoMatrix, the XmGeoMajorLayout(s) structures, the XmKidGeometry(s) structures, and mallocs an extra ``extSize'' bytes for any extension that will be used. It returns a pointer to the allocated structure. Note that it doesn't fill in any information in the matrix - it just allocates it.

_XmGeoMatrixAlloc


XmGeoMatrix _XmGeoMatrixAlloc(unsigned int numRows,
                              unsigned int numBoxes,
                              unsigned int extSize);

The next function verifies that the child being examined is valid, and sets up the XmKidGeometry structure to point at this kid.

_XmGeoSetupKid


Boolean _XmGeoSetupKid(XmKidGeometry geo, Widget kidWid);

For those of you interested in writing subclass widgets, those two functions are all you really need to know (well, except for knowing how to use them, of course). The rest of the functions are either internal, or buried within the BulletinBoard class.

Finally, when geometry management is complete, the following function deallocates the matrix.

_XmGeoMatrixFree


void _XmGeoMatrixFree(XmGeoMatrix geo_spec);


next up previous contents index
Next: 2. Layout Management Functions Up: 4. The GeoUtils Functions Previous: 4. The GeoUtils Functions   Contents   Index
Danny Backx
2000-12-13