Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

PtSetWidgetStyle()

Set the current style for a widget

Synopsis:

int PtSetWidgetStyle( PtWidget_t *widget,
                      char *name );

Library:

ph

Description:

This function causes the provided widget to use the style called name from its widget class's style set.

If there isn't a style called name, this function creates a duplicate of the default style and calls the copy name. The widget then references this new style. If at a later time you modify the style, all widgets referencing it reextent (resize) and redraw themselves.


Note: You can also set the style for a widget instance by setting its Pt_ARG_STYLE resource (defined by PtBasic). Setting this resource has the same effect as calling PtSetWidgetStyle().

Returns:

The index of the style selected.

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:

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

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