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

# XmTextGetString(3)

A Text function that accesses the string value

## NAME

**XmTextGetString** — A Text function that accesses the string value

## SYNOPSIS

```
#include <Xm/Text.h>
char * XmTextGetString(
Widget widget);
```

## DESCRIPTION

**XmTextGetString** accesses the string value of the Text widget. The application is responsible for freeing the storage associated with the string by calling **XtFree**.

- *widget*

  Specifies the Text widget ID

For a complete definition of Text and its associated resources, see [**XmText**(3)](/XmText/3.md).

## RETURN

Returns a character pointer to the string value of the text widget. This returned value is a copy of the value of the **XmNvalue** resource. Returns an empty string if the length of the Text widget's string is 0 (zero).

## RELATED

[**XmText**(3)](/XmText/3.md) and [**XmTextGetStringWcs**(3)](/XmTextGetStringWcs/3.md).
