PtAddClassStyle()

Add a style to a widget class

Synopsis:

int PtAddClassStyle(
       PtWidgetClassRef_t * const ref,
       PtWidgetClassStyle_t *style );

Library:

ph

Description:

This function adds the given style to the specified widget class, ref. If a style of the same name already exists in the widget class, the contents of the new style replace the old style, and the new style is freed.


Note: To further manipulate the given style, you must get a new pointer to it by calling PtFindClassStyle() or PtGetWidgetStyle().

A style is a collection of override methods that can change how a widget looks and behaves. Styles can also add widget resources.

Returns:

The index of the style, or -1 if it couldn't be added.

Examples:

See Widget Styles in the Managing Widgets in Application Code chapter of the Photon Programmer's Guide.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtCreateClassStyle(), PtDupClassStyle(), PtFindClassStyle(), PtGetStyleMember(), PtGetWidgetStyle(), PtSetClassStyleMethods(), PtSetStyleMember(), PtSetStyleMembers(), PtSetWidgetStyle(),

Pt_ARG_STYLE resource of PtBasic in the Photon Widget Reference

Widget Styles in the Managing Widgets in Application Code chapter of the Photon Programmer's Guide