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

# XmDataFieldGetString(3)

A DataField function that accesses the string value

## NAME

**XmDataFieldGetString** — A DataField function that accesses the string value

## SYNOPSIS

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

## DESCRIPTION

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

- *widget*

  Specifies the DataField widget ID

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

## RETURN

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

## RELATED

[**XmDataField**(3)](/XmDataField/3.md) and [**XmDataFieldGetStringWcs**(3)](/XmDataFieldGetStringWcs/3.md).
