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


XmQTcontainer

A widget holding this trait can manage widgets holding the XmQTcontainerItem trait

Format

#include <Xm/ContainerT.h>
typdef struct {
        	Mask            valueMask;
        	Cardinal        *detail_order;
        	Cardinal        detail_order_count;
        	XmTabList       detail_tablist;
        	Dimension       first_column_width;
        	unsigned char   selection_mode;
        	Pixel           select_color;
} XmContainerDataRec, *XmContainerData;
typdef struct {
        	int                             version;
        	XmContainerGetValuesProc        getValues;
} XmContainerTraitRec, *XmContainerTrait;
void
(*XmContainerGetValuesProc)WidgetXmContainerData

DESCRIPTION

A widget holding the XmQTcontainer trait is capable of acting as a container manager to suitable container child widgets. The only standard Motif widget to hold this trait is XmContainer. XmIconGadget is the only standard Motif widget that asks other widgets if they hold this trait.

If you are writing your own container widget, then it must hold the XmQTcontainer trait. Similarly, if you are writing your own container child widget, then it must call the getValues trait method of XmQTcontainer to determine its own geometry and to render its visuals.

The getValues Trait Method
void getValuesWidget
containerWidgetXmContainerData
containerData

A container child widget calls the getValues trait method of its parent container. The information returned by the container helps a container child determine its geometry and render itself.

containerWidget
Specifies the container widget holding this trait.

containerData
The caller (that is, the container child widget) must pass an XmContainerData structure as an argument. The caller must supply a value for the first field of the structure, valueMask, to indicate which fields the caller is interested in. The callee (that is, the container widget) must return a value for all the fields of the structure that are indicated by valueMask. In addition, the callee can optionally return values for fields not marked by valueMask. Following is a description of each of the fields of the XmContainerData structure:

valueMask
The caller supplies a value to indicate which fields it is interested in. Valid values are as follows:

ContAllValid
The container widget must return a value for all fields.

ContDetailOrder
The container widget must return a value for the detail_order and detail_order_count fields.

ContDetailTabList
The container widget must return a value for the detail_tablist field.

ContFirstColumnWidth
The container widget must return a value for the first_column_width field.

ContSelectionMode
The container widget must return a value for the selection_mode field.

ContSelectColor
The container widget must return a value for the select_color field.

detail_order
The container widget returns an array of Cardinals that specify the detail columns to be rendered and their positions. If the container widget is XmContainer, then the returned value corresponds to the XmNdetailOrder resource of XmContainer. The data returned must not be modified or freed.

detail_order_count
The container widget returns a count of the number of Cardinals in the detail_order field. If the detail_order field is NULL and the container widget returns 0, then no details should be displayed by the caller. However, if the detail_order field is NULL and the container widget returns a nonzero value, the caller must interpret the value as the size of a virtual detail_order array [1,2..n]. If the container widget is XmContainer, then the returned value corresponds to the XmNdetailOrderCount resource of XmContainer.

detail_tablist
The container widget must return an XmTabList specifying the start of each column in the XmDETAIL view. If the container widget is XmContainer, the returned detail_tablist will be the value of the XmNdetailTabList resource. The data returned must not be modified or freed.

first_column_width
The container widget must return the width of the first column to be used for rendering the label and pixmap of each container child widget. The returned width must include the indentation to be used for each level of the outline. If the container widget is XmContainer, the value of the first_column_width corresponds to the value of the XmNfirstColumnWidth resource.

selection_mode
The container returns the selection mode currently in use. The possible values are XmNORMAL_MODE and XmADD_MODE. The caller must draw its border highlight with a solid line in normal mode and with a dashed line in add mode.

select_color
The container widget returns the background color to be used by the caller when it redisplays itself in the selected state. If the container widget is XmContainer, the value of select_color corresponds to the value of the XmNselectColor resource.

RELATED

ExmGrid(3), XmContainer(3), XmIconGadget(3), XmQTcontainerItem(3), XmSeparator(3), and XmTabList(3).


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