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

# XmDirectionToStringDirection(3)

A function that converts an XmDirection value to an XmStringDirection value

## NAME

**XmDirectionToStringDirection** — A function that converts an XmDirection value to an XmStringDirection value

## SYNOPSIS

```
#include <Xm/Xm.h>
XmStringDirection XmDirectionToStringDirection (dir)
        XmDirection     dir;
(void)
```

## DESCRIPTION

**XmDirectionToStringDirection** converts the specified **XmDirection** direction value to its equivalent **XmStringDirection** value. Basically, if the **XmDirection** value has a horizontal direction specification, that horizontal element is used; otherwise, the **XmStringDirection** value is interpreted as **XmSTRING\_DIRECTION\_L\_TO\_R**. This function provides backward compatibility with the **XmStringDirection** data type.

Note that the Motif toolkit also contains an **XmStringDirectionToDirection** routine to convert an **XmStringDirection** value to its **XmDirection** equivalent.

- *dir*

  Specifies the **XmDirection** value to be converted.

## RETURN

Returns the following **XmStringDirection** values:

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

  If the *dir* argument has a right to left horizontal direction value in it, for example **XmRIGHT\_TO\_LEFT\_TOP\_TO\_BOTTOM**.

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

  If the *dir* argument has a left to right horizontal direction in it, for example **XmLEFT\_TO\_RIGHT\_TOP\_TO\_BOTTOM**, or if the horizontal direction value in the *dir* argument is ambiguous, such as in the **XmTOP\_TO\_BOTTOM** value.

- **XmSTRING\_DIRECTION\_DEFAULT**

  If there was no horizontal direction specified.

## RELATED INFORMATION

[**XmDirection**(3)](/XmDirection/3.md), [**XmDirectionMatch**(3)](/XmDirectionMatch/3.md), [**XmDirectionMatchPartial**(3)](/XmDirectionMatchPartial/3.md), [**XmDirectionToStringDirection**(3)](/XmDirectionToStringDirection/3.md), [**XmString**(3)](/XmString/3.md), [**XmStringDirection**(3)](/XmStringDirection/3.md), and [**XmStringDirectionToDirection**(3)](/XmStringDirectionToDirection/3.md),
