Add data to the widget data chain
int PtAddWidgetData( PtWidget_t *widget, PtWidgetClassRef_t *type, long subtype, void *data );
This function adds a piece of data to the widget data chain. The data provided must be in a block of memory allocated by malloc(). This data can be retrieved by calling PtFindWidgetData() or PtFindNextWidgetData().
The widget argument points to the widget whose chain the data should be added to. The type is the class of the widget adding the data. The subtype is used to discriminate between multiple blocks of data added by the same widget class. The subtype shouldn't be -1, as this value has special meaning when searching for a specific block within the widget data chain. The data argument is a pointer to the data to be added to the widget data chain.
0 on success; -1 if an error occurred (e.g. out of memory).
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PtFindWidgetData(), PtFindNextWidgetData(), PtRemoveWidgetData()