[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Widget Writer's Guide


XmQTspecifyRenderTable

A widget holding this trait can supply the names of its default render tables to any requestor

Format

#include <Xm/SpecRenderT.h>
 
typedef struct {
        	int                             version;
        	XmSpecRenderGetTableProc        getRenderTable;
} XmSpecRenderTraitRec, *XmSpecRenderTrait;
XmRenderTable
(*XmSpecRenderGetTableProc)WidgetXtEnum

DESCRIPTION

A widget holding the XmQTspecifyRenderTable trait is responsible for providing a requestor with a suitable render table. Any manager widget holding this trait should provide the following three resources:

  1. A resource to hold the label render table

  2. A resource to hold the button render table

  3. A resource to hold the text render table

    The getRenderTable trait method of XmQTspecifyRenderTable will use the values of the three resources as the basis for its returned information.

    The XmQTspecifyRenderTable trait is somewhat unusual in that other widgets do not access its trait method through the usual trait mechanisms. Instead, other widgets access the getRenderTable trait method by calling XmeGetDefaultRenderTable.

    The following standard Motif widgets hold this trait:

    1. XmBulletinBoard and all its subclasses

    2. XmVendorShell and all its subclasses

    3. XmMenuShell

      The ExmGrid demonstration widget also installs this trait.

    4. The getRenderTable Trait Method
      XmRenderTable getRenderTableWidget
      widgetXtEnum renderTableType

      The getRenderTable trait method returns a render table corresponding to the renderTableType of widget widget. This value (if non-NULL) is the internal value of the manager's render table, and should not be modified or freed.

      For example, given a manager widget named MyManagerWidget that supports the correct render table resources, the following is a sample implementation of the trait method:



      static XmRenderTable
      GetRenderTable( Widget widget,
                      XtEnum renderTableType)
      {
      XmMyManagerWidget mm = (XmMyManagerWidget) widget;
       switch(renderTableType) {
         case XmLABEL_RENDER_TABLE: return mm->my_manager.label_render_table;
         case XmBUTTON_RENDER_TABLE: return
      mm->my_manager.button_render_table;
         case XmTEXT_RENDER__RENDER_TABLE: return
      mm->my_manager.text_render_table;
       }
       return NULL;
      }

      widget
      Specifies the widget containing render table information.

      renderTableType
      Specifies the desired type of render table; the specified value must be one of the following: XmLABEL_RENDER_TABLE, XmBUTTON_RENDER_TABLE, and XmTEXT_RENDER_TABLE.

      RELATED

      XmBulletinBoard(3), VendorShell(3), XmMenuShell(3), and XmeGetDefaultRenderTable(3).


      [ Previous | Next | Contents | Glossary | Home | Search ]