Private Header File The private header file contains the complete declaration of the class and instance structures for the widget and any additional private data that will be required by anticipated subclasses of the widget. Information in the private header file is normally hidden from the application and is designed to be accessed only through other public procedures; e.g. XtSetValues . The contents of the Template private header file, < X11/Xaw/TemplateP.h >, are: /* Copyright (c) X Consortium 1987, 1988 */ #ifndef _TemplateP_h #define _TemplateP_h #include <X11/Xaw/Template.h> /* include superclass private header file */ #include <X11/CoreP.h> /* define unique representation types not found in <X11/StringDefs.h> */ #define XtRTemplateResource "TemplateResource" typedef struct { int empty; } TemplateClassPart; typedef struct _TemplateClassRec { CoreClassPart core_class; TemplateClassPart template_class; } TemplateClassRec; extern TemplateClassRec templateClassRec; typedef struct { /* resources */ char* resource; /* private state */ } TemplatePart; typedef struct _TemplateRec { CorePart core; TemplatePart template; } TemplateRec; #endif /* _TemplateP_h */ The private header file includes the private header file of its superclass, thereby exposing the entire internal structure of the widget. It may not always be advantageous to do this; your own project development style will dictate the appropriate level of detail to expose in each module. The "WindowWidget" needs to declare two fields in its instance structure to hold the drawing colors, a resource field for the font and a field for the expose and user input callback lists: typedef struct { /* resources */ Pixel color_1; Pixel color_2; XFontStruct* font; XtCallbackList expose_callback; XtCallbackList input_callback; /* private state */ /* (none) */ } WindowPart;