Athena Widget Set - C Language Interface - X Consortium ... - X.Org
Athena Widget Set - C Language Interface - X Consortium ... - X.Org
Athena Widget Set - C Language Interface - X Consortium ... - X.Org
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Creating New <strong>Widget</strong>s(Subclassing)* Template widget*****************************************************************//* Resources:Name Class RepType Default Value---- ----- ------- -------------background Background Pixel XtDefaultBackgroundborder BorderColor Pixel XtDefaultForegroundborderWidth BorderWidth Dimension 1destroyCallback Callback Pointer NULLheight Height Dimension 0mappedWhenManaged MappedWhenManaged Boolean Truesensitive Sensitive Boolean Truewidth Width Dimension 0x Position Position 0y Position Position 0*//* define any special resource names here that are not in */#define XtNtemplateResource "templateResource"#define XtCTemplateResource "TemplateResource"/* declare specific Template<strong>Widget</strong> class and instance datatypes */typedef struct _TemplateClassRec* Template<strong>Widget</strong>Class;typedef struct _TemplateRec* Template<strong>Widget</strong>;/* declare the class constant */extern <strong>Widget</strong>Class template<strong>Widget</strong>Class;#endif /* _Template_h */You will notice that most of this file is documentation. The crucial parts are the last8 lines where macros for any private resource names and classes are defined andwhere the widget class datatypes and class record pointer are declared.For the "Window<strong>Widget</strong>", we want 2 drawing colors, a callback list for user input andan exposeCallback callback list, and we will declare three convenience procedures,so we need to add/* Resources:...callback Callback Callback NULL129