The XmPrimitive widget maintains the values of its resources inside the fields of the primitive structure. For example, the value of the XmNhighlightThickness resource is stored in the primitive.highlight_thickness field. Your primitive widget can access any of these fields. For example, the following code accesses the primitive.highlight_thickness field:
total_width_of_highlight = primitive.highlight_thickness * 2;
In addition to all the resource values, the primitive structure also holds several fields that are not tied to resources. Widget writers should become familiar with the fields shown in the following subsections.
The have_traversal field is declared as follows:
Boolean have_traversal;
This is a flag whose initial value is False. This flag becomes True only when both of the following happen:
When the widget loses keyboard focus, this flag is reset to False. Similarly, if the keyboard focus policy becomes XmPOINTER, this flag is reset to False.
The highlighted field is declared as follows:
Boolean highlighted;
This is a flag. Widgets must set this flag to True after drawing a highlight around the widget's border. Widgets must set this flag to False after removing the highlight. The flag's initial value is False.
The highlight_GC field is declared as follows:
GC highlight_GC;
The border_highlight method of the XmPrimitive widget uses this GC when rendering the border highlight.
The primitive.highlight_GC contains the default GC generated by XtGetGC, except for the following differences:
If the XmNhighlightPixmap resource of XmPrimitive contains something other than XmUNSPECIFIED_PIXMAP or None, then the highlight_GC also contains the following:
The top_shadow_GC field is declared as follows:
GC top_shadow_GC;
XmPrimitive uses primitive.top_shadow_GC when rendering the top shadow. The primitive.top_shadow_GC field contains the default GC generated by XtGetGC, except for the following differences:
If the XmNtopShadowPixmap resource of XmPrimitive contains something other than XmUNSPECIFIED_PIXMAP or None, then the highlight_GC also contains the following:
The bottom_shadow_GC field is declared as follows:
GC bottom_shadow_GC;
XmPrimitive uses primitive.bottom_shadow_GC when rendering the bottom shadow. The primitive..bottom_shadow_GC field contains the default GC generated by XtGetGC, except for the following differences:
If the XmNbottomShadowPixmap resource of XmPrimitive contains something other than XmUNSPECIFIED_PIXMAP or None, then the highlight_GC also contains the following: