12.07.2015 Views

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

SHOW MORE
SHOW LESS

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)drawingColor1 Color Pixel XtDefaultForegrounddrawingColor2 Color Pixel XtDefaultForegroundexposeCallback Callback Callback NULLfont Font XFontStruct* XtDefaultFont...*/#define XtNdrawingColor1 "drawingColor1"#define XtNdrawingColor2 "drawingColor2"#define XtNexposeCallback "exposeCallback"extern Pixel WindowColor1(\|/* <strong>Widget</strong> */\|);extern Pixel WindowColor2(\|/* <strong>Widget</strong> */\|);extern Font\ \ WindowFont(\|/* <strong>Widget</strong> */\|);Note that we have chosen to call the input callback list by the generic name, callback,rather than a specific name. If widgets that define a single user-input actionall choose the same resource name then there is greater possibility for an applicationto switch between widgets of different types.Private Header FileThe private header file contains the complete declaration of the class and instancestructures for the widget and any additional private data that will be required byanticipated subclasses of the widget. Information in the private header file is normallyhidden from the application and is designed to be accessed only through otherpublic procedures; e.g. Xt<strong>Set</strong>Values .The contents of the Template private header file, < X11/Xaw/TemplateP.h >, are:/* Copyright (c) X <strong>Consortium</strong> 1987, 1988*/#ifndef _TemplateP_h#define _TemplateP_h#include /* include superclass private header file */#include /* define unique representation types not found in */#define XtRTemplateResource "TemplateResource"typedef struct {int empty;} TemplateClassPart;typedef struct _TemplateClassRec {CoreClassPart core_class;TemplateClassPart template_class;} TemplateClassRec;130

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!