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)static XtResource resources[] = {#define offset(field) XtOffsetOf(TemplateRec, template.field)/* {name, class, type, size, offset, default_type, default_addr}, */{ XtNtemplateResource, XtCTemplateResource, XtRTemplateResource,sizeof(char*), offset(resource), XtRString, (XtPointer) "default" },#undef offset};static void TemplateAction(/* <strong>Widget</strong>, XEvent*, String*, Cardinal* */);static XtActionsRec actions[] ={/* {name, procedure}, */{"template", TemplateAction},};static char translations[] =" : template(\|) \\n\\";TemplateClassRec templateClassRec = {{ /* core fields *//* superclass */ (<strong>Widget</strong>Class) &widgetClassRec,/* class_name */ "Template",/* widget_size */ sizeof(TemplateRec),/* class_initialize */ NULL,/* class_part_initialize */ NULL,/* class_inited */ FALSE,/* initialize */ NULL,/* initialize_hook */ NULL,/* realize */ XtInheritRealize,/* actions */ actions,/* num_actions */ XtNumber(actions),/* resources */ resources,/* num_resources */ XtNumber(resources),/* xrm_class */ NULLQUARK,/* compress_motion */ TRUE,/* compress_exposure */ TRUE,/* compress_enterleave */ TRUE,/* visible_interest */ FALSE,/* destroy */ NULL,/* resize */ NULL,/* expose */ NULL,/* set_values */ NULL,/* set_values_hook */ NULL,/* set_values_almost */ XtInherit<strong>Set</strong>ValuesAlmost,/* get_values_hook */ NULL,/* accept_focus */ NULL,/* version */ XtVersion,/* callback_private */ NULL,/* tm_table */ translations,/* query_geometry */ XtInheritQueryGeometry,/* display_accelerator */ XtInheritDisplayAccelerator,/* extension */ NULL132

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

Saved successfully!

Ooh no, something went wrong!