---
name: "XmTabStack"
section: "3"
platform: "linux"
package: "openmotif"
version: "2.3.8-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/XmTabStack"
---

# XmTabStack(3)

The TabStack widget class

## NAME

**XmTabStack** - The TabStack widget class

## SYNOPSIS

\#include \<Xm/TabStack.h\>

## DESCRIPTION

The XmTabStack widget manages a group of widgets such that only one widget in the group is visible at a time. Each child is associated with a "tab" that displays a text label and/or a pixmap. By selecting the "tab" the user interactively determines which child is displayed. This widget exhibits behavior similar to the Microsoft Windows(TM) Tab Control.

The tabs can be configured to appear above, below, to the right, and to the left of a work area with the text oriented in any of the four cardinal directions.

The TabStack allows the user to select, either by pointer or keyboard traversal, tabs.  When a tab is selected it changes appearance so that it appears to be raised above the other tabs.  When a tab is selected the child associated with the tab is made visible. One tab is selected at all times.

### Classes

TabStack inherits behavior and resources form **Core**, **Composite**, **Constraint**, **XmManager** and **XmBulletinBoard Classes.**

**The class pointer is xmTabStackWidgetClass.**

**The class name is XmTabStack.**

### New Resources

**The following table defines a set of widget resources used by the** **programmer to specify data.  The programmer can also set the resource** **values for the inherited classes to set attributes for this widget.  To** **reference a resource by name or by class in a .Xdefaults file, remove** **the XmN or XmC prefix and use the remaining letters.  To** **specify one of the defined values for a resource in a .Xdefaults file,** **remove the Xm or prefix and use the remaining letters** **(in either lowercase or uppercase, but include any underscores between** **words).** **The codes in the access column indicate if the given resource can be** **set at creation time(C),** **set by using XtSetValues (S),** **retrieved by using XtGetValues (G), or is not applicable (N/A).**

| | | |
| --- | --- | --- |
| **XmTabStack Resource Set** |
| **Name** | **Default** | **Access** |
| **Class** | **Type** |
| XmNfontList | Dynamic | CSG |
| XmCFontList | XmFontList |
| XmNhighlightThickness | 2 | CSG |
| XmCHighlightThickness | Dimension |
| XmNstackedEffect | True | CSG |
| XmCStackedEffect | Boolean |
| XmNtabAutoSelect | True | CG |
| XmCTabAutoSelect | Boolean |
| XmNtabCornerPercent | 40 | CSG |
| XmCTabCornerPercent | int |
| XmNtabLabelSpacing | 2 | CSG |
| XmCTabLabelSpacing | Dimension |
| XmNtabMarginHeight | 3 | CSG |
| XmCTabMarginHeight | Dimension |
| XmNtabMarginWidth | 3 | CSG |
| XmCTabMarginWidth | Dimension |
| XmNtabMode | XmTABS\_BASIC | CSG |
| XmCTabMode | int |
| XmNtabOffset | 10 | CSG |
| XmCTabOffset | Dimension |
| XmNtabOrientation | Dynamic | CSG |
| XmCTabOrientation | int |
| XmNtabSelectColor | Dynamic | CSG |
| XmCTabSelectColor | Pixel |
| XmNtabSelectedCallback | NULL | CS |
| XmCCallback | XtCallbackList |
| XmNtabSelectPixmap | XmUNSPECIFIED\_PIXMAP | CSG |
| XmCTabSelectPixmap | Pixmap |
| XmNtabSide | XmTABS\_ON\_TOP | CSG |
| XmCTabSide | int |
| XmNtabStyle | XmTABS\_BEVELED | CSG |
| XmCTabStyle | int |
| XmNuniformTabSize | True | CSG |
| XmCUniformTabSize | Boolean |
| XmNuseImageCache | True | CSG |
| XmCUseImageCache | Boolean |

- **XmNfontList**

  **Specifies the XmFontList to use when drawing the label strings for the** **tabs.**

- **XmNhighlightThickness**

  **Specifies the thickness of the rectangle drawn around the label string** **and label pixmap of the tab with keyboard traversal.**

- **XmNstackedEffect**

  **Specifies if the visuals should depict a stack of folders, True, or if** **the XmTabStack should use all available space for its children, False.**

- **XmNtabAutoSelect**

  **Specifies if a tab is automatically selected when it receives keyboard** **traversal.**

- **XmNtabCornerPercent**

  **Specifies the percent of the font height that should be used for the** **corner visual.**

- **XmNtabLabelSpacing**

  **Specifies the amount of space to leave between a text label and a** **pixmap in the tab area.**

- **XmNtabMarginHeight**

  **Specifies the vertical border that is placed around the label area of** **a tab.**

- **XmNtabMarginWidth**

  **Specifies the horizontal border that is placed around the label area** **of a tab.**

- **XmNtabMode**

  **Specifies the mode in which the XmTabStack distributes the tabs. Valid** **values for this resource include:**

  - **XmTABS\_BASIC**

    **Distributes the tabs in either a vertical or** **horizontal row and clips the tabs if there is not enough room to** **display all the tabs.**

  - **XmTABS\_STACKED**

    **Distributes the tabs in either a vertical or horizontal row. If there** **is not enough room to display all the tabs additional rows are added.** **When a tab is selected, its row is moved next to the children in the** **stack.**

  - **XmTABS\_STACKED\_STATIC**

    **Distributes the tabs in either a vertical or horizontal row. If there** **is not enough room to display all the tabs additional rows are** **added. The positions of rows are not changed when tabs are selected.**

- **XmNtabOffset**

  **Specifies the amount of indentation used to stagger the tab rows when** **displaying tabs in either the XmTABS\_STACKED or** **XmTABS\_STACKED\_STATIC mode.**

- **XmNtabOrientation**

  **Specifies the orientation of the tab, and the rotation factor of** **the tab label. Valid values for this resource include:**

  - **XmTAB\_ORIENTATION\_DYNAMIC**

    **Specifies that the orientation of the tabs should be calculated** **dynamically based on the XmNtabSide resource.**

  - **XmTABS\_LEFT\_TO\_RIGHT**

    **Specifies that the text appears at the default rotation.**

  - **XmTABS\_RIGHT\_TO\_LEFT**

    **Specifies that the text appears upside down.**

  - **XmTABS\_TOP\_TO\_BOTTOM**

    **Specifies that the text should be rotated to the vertical position** **with the first character drawn at the lowest y position and the bottom** **of the text faces the lowest x position.**

  - **XmTABS\_BOTTOM\_TO\_TOP**

    **Specifies that the text should be rotated to the vertical, position** **with the first character drawn at the highest y position and the bottom** **of the text faces the highest x position.**

- **XmNtabSelectColor**

  **Specifies the color of the selected tab.**

- **XmNtabSelectedCallback**

  **Specifies the list of callbacks to call when a child becomes the** **selected tab.**

- **XmNtabSelectPixmap**

  **Specifies the pixmap of the selected tab.**

- **XmNtabSide**

  **Specifies the location of the tab with respect to the children of the** **XmTabStack. Valid values for this resource include:**

  - **XmTABS\_ON\_TOP**

    **Specifies that the tabs should be placed above the children.**

  - **XmTABS\_ON\_BOTTOM**

    **Specifies that the tabs should be placed below the children.**

  - **XmTABS\_ON\_RIGHT**

    **Specifies that the tabs should be placed to the right of the children.**

  - **XmTABS\_ON\_LEFT**

    **Specifies that the tabs should be placed to the left of the children.**

- **XmNtabStyle**

  **Specifies the appearance of the tabs associated with the children** **of the XmTabStack. Valid values for this resource include:**

  - **XmTABS\_BEVELED**

    **Draws the corners of the tabs as an angled line.**

  - **XmTABS\_ROUNDED**

    **Draws the corners of the tabs as a quarter of a circle.**

  - **XmTABS\_SQUARED**

    **Draws the tabs as rectangles.**

- **XmNuniformTabSize**

  **Determines if all tabs should have a uniform major dimension,** **where the major dimension is width if the tab orientation is** **XmTABS\_LEFT\_TO\_RIGHT or XmTABS\_RIGHT\_TO\_LEFT or height if** **the tab orientation is XmTABS\_TOP\_TO\_BOTTOM or** **XmTABS\_BOTTOM\_TO\_TOP. When XmNtabMode is either** **XmTABS\_STACKED or XmTABS\_STACKED\_STATIC, this resource is forced** **to True.**

- **XmNuseImageCache**

  **Destermines if the Xmmages used for rotating text and pixmaps should** **be cached. This increases performance but uses up more memory.**

  | | | |
  | --- | --- | --- |
  | **XmTabStack Constraint Resource Set** |
  | **Name** | **Default** | **Access** |
  | **Class** | **Type** |
  | XmNfreeTabPixmap | False | CSG |
  | XmCFreeTabPixmap | Boolean |
  | XmNtabAlignment | XmALIGNMENT\_CENTER | CSG |
  | XmCAlignment | unsigned char |
  | XmNtabBackground | Dynamic | CSG |
  | XmCBackground | Pixel |
  | XmNtabBackgroundPixmap | Dynamic | CSG |
  | XmCBackgroundPixmap | Pixmap |
  | XmNtabForeground | Dynamic | CSG |
  | XmCForeground | Pixel |
  | XmNtabLabelPixmap | XmUNSPECIFIED\_PIXMAP | CSG |
  | XmCTabLabelPixmap | Pixmap |
  | XmNtabLabelString | NULL | CSG |
  | XmCTabLabelString | XmString |
  | XmNtabPixmapPlacement | XmPIXMAP\_RIGHT | CSG |
  | XmCTabPixmapPlacement | XmPixmapPlacement |
  | XmNtabStringDirection | XmSTRING\_DIRECTION\_DEFAULT | CSG |
  | XmCTabStringDirection | unsigned char |

- **XmNfreeTabPixmap**

  **Specifies that the pixmaps assigned to the XmNlabelPixmap** **resources should be freed when the widget is destroyed.**

- **XmNtabAlignment**

  **Specifies the alignment of the tab label. Valid values for this** **resource include:**

  - **XmALIGNMENT\_BEGINNING**

    **Aligns the label to the left side of the available space.**

  - **XmALIGNMENT\_CENTER**

    **Aligns the label centered in the available space.**

  - **XmALIGNMENT\_END**

    **Aligns the label to the right side of the available space.**

- **XmNtabBackground**

  **Specifies the background pixel for the tab.**

- **XmNtabBackgroundPixmap**

  **Specifies the background pixmap for the tab.**

- **XmNtabForeground**

  **Specifies the foreground pixel for the tab.**

- **XmNtabLabelPixmap**

  **Specifies the pixmap to display in the tab label.**

- **XmNtabLabelString**

  **Specifies the XmString to display as the textual portion of the tab** **label. This is copied when set on the widget. The value fetched via** **XtGetValues should not be freed as it returns a pointer to the widgets** **value. If you wish to use the value returned from XtGetValues use** **XmStringCopy the returned value.**

- **XmNtabPixmapPlacement**

  **Specifies the location of the pixmap with respect to the text in the** **tab label. Valid values for this resource include:**

  - **XmPIXMAP\_TOP**

    **Specifies that the pixmap should be above the XmString.**

  - **XmPIXMAP\_BOTTOM**

    **Specifies that the pixmap should be below the XmString.**

  - **XmPIXMAP\_RIGHT**

    **Specifies that the pixmap should be to the right of the XmString.**

  - **XmPIXMAP\_LEFT**

    **Specifies that the pixmap should be to the left of the XmString.**

  - **XmPIXMAP\_ONLY**

    **Specifies that only the pixmap portion of the tab label should be** **displayed.**

  - **XmPIXMAP\_NONE**

    **Specifies that only the XmString portion of the tab label should be** **displayed.**

- **XmNtabStringDirection**

  **Specifies the string direction for the XmString portion of the tab** **label. Valid values for this resouce include:**

  - **XmSTRING\_DIRECTION\_L\_TO\_R**

    **Left to right**

  - **XmSTRING\_DIRECTION\_R\_TO\_L**

    **Right to left**

### Inherited Resources

**TabStack inherits behavior and resources from the following** **superclasses. For a complete description of each resource, refer to** **the man page for that superclass.**

| | | |
| --- | --- | --- |
| **XmBulletinBoard Resource Set** |
| **Name** | **Default Access** |
| Class | Type |
| XmNallowOverlap | True | CSG |
| XmCAllowOverlap | Boolean |
| XmNautoUnmanage | False | CG |
| XmCAutoUnmanage | Boolean |
| XmNbuttonFontList | dynamic | CSG |
| XmCButtonFontList | XmFontList |
| XmNcancelButton | NULL | SG |
| XmCWidget | Widget |
| XmNdefaultButton | NULL | SG |
| XmCWidget | Widget |
| XmNdefaultPosition | True | CSG |
| XmCDefaultPosition | Boolean |
| XmNdialogStyle | dynamic | CSG |
| XmCDialogStyle | unsigned char |
| XmNdialogTitle | NULL | CSG |
| XmCDialogTitle | XmString |
| XmNfocusCallback | NULL | C |
| XmCCallback | XtCallbackList |
| XmNlabelFontList | dynamic | CSG |
| XmCLabelFontList | XmFontList |
| XmNmapCallback | NULL | C |
| XmCCallback | XtCallbackList |
| XmNmarginHeight | 10 | CSG |
| XmCMarginHeight | Dimension |
| XmNmarginWidth | 10 | CSG |
| XmCMarginWidth | Dimension |
| XmNnoResize | False | CSG |
| XmCNoResize | Boolean |

| | | |
| --- | --- | --- |
| **XmManager Resource Set** |
| **Name** | **Default Access** |
| Class | Type |
| XmNbottomShadowColor | dynamic | CSG |
| XmCBottomShadowColor | Pixel |
| XmNbottomShadowPixmap | XmUNSPECIFIED\_PIXMAP | CSG |
| XmCBottomShadowPixmap | Pixmap |
| XmNforeground | dynamic | CSG |
| XmCForeground | Pixel |
| XmNhelpCallback | NULL | C |
| XmCCallback | XtCallbackList |
| XmNhighlightColor | dynamic | CSG |
| XmCHighlightColor | Pixel |
| XmNhighlightPixmap | dynamic | CSG |
| XmCHighlightPixmap | Pixmap |
| XmNinitialFocus | dynamic | CSG |
| XmCInitialFocus | Widget |
| XmNnavigationType | XmTAB\_GROUP | CSG |
| XmCNavigationType | XmNavigationType |
| XmNshadowThickness | 2 | CSG |
| XmCShadowThickness | Dimension |
| XmNstringDirection | dynamic | CG |
| XmCStringDirection | XmStringDirection |
| XmNtopShadowColor | dynamic | CSG |
| XmCTopShadowColor | Pixel |
| XmNtopShadowPixmap | dynamic | CSG |
| XmCTopShadowPixmap | Pixmap |
| XmNtraversalOn | True | CSG |
| XmCTraversalOn | Boolean |
| XmNunitType | dynamic CSG |
| XmCUnitType | unsigned char |
| XmNuserData | NULL | CSG |
| XmCUserData | XtPointer |

| | | |
| --- | --- | --- |
| **Composite Resource Set** |
| **Name** | **Default Access** |
| Class | Type |
| XmNchildren | NULL | G |
| XmCReadOnly | WidgetList |
| XmNinsertPosition | NULL | CSG |
| XmCInsertPosition | XtOrderProc |
| XmNnumChildren | 0 | G |
| XmCReadOnly | Cardinal |

| | | |
| --- | --- | --- |
| **Core Resource Set** |
| **Name** | **Default Access** |
| Class | Type |
| XmNaccelerators | dynamic | N/A |
| XmCAccelerators | XtAccelerators |
| XmNancestorSensitive | dynamic | G |
| XmCSensitive | Boolean |
| XmNbackground | dynamic | CSG |
| XmCBackground | Pixel |
| XmNbackgroundPixmap | XmUNSPECIFIED\_PIXMAP | CSG |
| XmCPixmap | Pixmap |
| XmNborderColor | XtDefaultForeground | CSG |
| XmCBorderColor | Pixel |
| XmNborderPixmap | XmUNSPECIFIED\_PIXMAP | CSG |
| XmCPixmap | Pixmap |
| XmNborderWidth | 0 | CSG |
| XmCBorderWidth | Dimension |
| XmNcolormap | dynamic | CG |
| XmCColormap | Colormap |
| XmNdepth | dynamic | CG |
| XmCDepth | int |
| XmNdestroyCallback | NULL | C |
| XmCCallback | XtCallbackList |
| XmNheight | dynamic | CSG |
| XmCHeight | Dimension |
| XmNinitialResourcesPersistent | True | C |
| XmCInitialResourcesPersistent | Boolean |
| XmNmappedWhenManaged | True | CSG |
| XmCMappedWhenManaged | Boolean |
| XmNscreen | Screen\* | dynamic |
| XmCScreen | Screen |
| XmNsensitive | True | CSG |
| XmCSensitive | Boolean |
| XmNtranslations | dynamic | CSG |
| XmCTranslations | XtTranslations |
| XmNwidth | dynamic | CSG |
| XmCWidth | Dimension |
| XmNx | 0 | CSG |
| XmCPosition | Position |
| XmNy | 0 | CSG |
| XmCPosition | Position |

### Calback Information

**A pointer to the following structure is passed to each callback:**

```
typedef struct _XmTabStackCallbackStruct {
	int	reason;
	XEvent	*event;
	Widget	selected_child;
} XmTabStackCallbackStruct;
```

- *reason*

  Indicates why the callback was invoked. Valid callbacks reasons include:

  - **XmCR\_TAB\_SELECTED**

    Indicates that a child has been made the selected widget.

- *event*

  Points to the **XEvent** that triggered the callback.

- *selected\_child*

  Contains the widget ID of the selected child.

### Translations

XmTabStack includes the translations from the XmManager.

### Additional Behavior

The XmTabStack has no additional behavior.

### Virtual Bindings

The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see **VirtualBindings(3X)**.

## RELATED INFORMATION

[**XmBulletinBoard**(3)](/XmBulletinBoard/3.md), [**Composite**(3)](/Composite/3.md), [**Constraint**(3)](/Constraint/3.md), [**Core**(3)](/Core/3.md), **XmCreateTabStack**(3), [**XmManager**(3)](/XmManager/3.md), [**XmVaCreateTabStack**(3)](/XmVaCreateTabStack/3.md), and [**XmVaCreateManagedTabStack**(3)](/XmVaCreateManagedTabStack/3.md).
