PtFindSurface()

Find the control surface with a given ID

Synopsis:

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

Library:

ph

Description:

This function locates a control surface belonging to a given widget, using the surface's numerical ID, surface_id, as a search key.

Returns:

A pointer to the structure representing the control surface, or NULL if the specified 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's a chance that the widget's surface configuration might have changed.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtFindSurfaceByAction(), PtWidgetActiveSurface()

Control Surfaces chapter of the Photon Programmer's Guide