Caution: This version of this document is no longer maintained. For the latest documentation, see


Force the control surface with a given ID to calculate its geometry


PtSurface_t *PtCalcSurfaceById(
                PtWidget_t *widget,
                unsigned char surface_id );




PtCalcSurfaceById() forces a control surface to calculate its geometry.

The widget argument specifies the widget owning the surface, while surface_id specifies the numeric ID of the surface to calculate. This function is useful if the geometry of one surface depends on that of another.

Note: This function call amounts to a no-op if the geometry for the specified surface has already been calculated for this pre/post-extent cycle.


A pointer to the specified surface on success, or NULL if the surface couldn't be found.

Note: Since control surfaces are maintained internally as an array, it's not uncommon for them to shift around in memory as surfaces are added and removed, thereby possibly invalidating a pointer returned by this function. As such, all surface pointers should be regarded as transient, and you should retrieve an updated copy whenever there is a chance that the widget's surface configuration might have changed.



Interrupt handler No
Signal handler No
Thread No

See also:

PtCalcSurface(), PtCalcSurfaceByAction(), PtSurfaceCalcBoundingBox(), PtSurfaceCalcBoundingBoxById(), PtSurfaceExtent(), PtSurfaceExtentById(), PtSurfaceRect(), PtSurfaceRectById()

Control Surfaces chapter of the Photon Programmer's Guide