Get a member of a style
void *PtGetStyleMember( PtWidgetClassStyle_t *style, int manifest );
ph
This function retrieves the value of the given style associated with the given manifest.
For a description of the possible manifests, see PtSetStyleMember().
The provided manifest determines the type of the pointer returned:
void (*draw_f)( PtWidget_t *widget, PhTile_t const *damage );
void (*sizing_f)( PtWidget_t *widget );
void (*activate_f)( PtWidget_t *widget, PtWidgetClassStyle_t *old_style );
This isn't the same as the widget's Pt_CB_ACTIVATE callback. |
void (*calc_border_f)( PtWidget_t const *widget, PhRect_t *border );
The style's borders are the distances from the widget's extent (i.e. the widget's outermost borders) to the widget's canvas (i.e. the content area of the widget). For example, if the style's border.ul.x is 5, there are five pixels between the widget's left extent and the left side of the widget's canvas. This space is typically used to render outlines, bevels, and so on.
void (*calc_opaque_f)( PtWidget_t *widget );
void (*deactivate_f)( PtWidget_t *widget, PtWidgetClassStyle_t *new_style );
PtGetStyleMember() returns NULL if the member specified isn't set or the manifest is invalid.
void display_style_name( PtWidgetClassStyle_t *style ) { char *name = PtGetStyleMember( style, Pt_STYLE_NAME ); printf( "Style: %s\n", name ? name : "Default"); }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PtAddClassStyle(), PtCreateClassStyle(), PtDupClassStyle(), PtFindClassStyle(), 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