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

# XmDataFieldXYToPos(3)

A DataField function that accesses the character position nearest an x and y position

## NAME

**XmDataFieldXYToPos** — A DataField function that accesses the character position nearest an x and y position

## SYNOPSIS

```
#include <Xm/DataF.h>
XmTextPosition XmDataFieldXYToPos(
Widget widget,
Position x,
Position y);
```

## DESCRIPTION

**XmDataFieldXYToPos** accesses the character position nearest to the specified *x* and *y* position, relative to the upper left corner of the DataField widget.

- *widget*

  Specifies the DataField widget ID

- *x*

  Specifies the *x* position, relative to the upper left corner of the widget.

- *y*

  Specifies the *y* position, relative to the upper left corner of the widget.

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

## RETURN

Returns the character position in the text nearest the *x* and *y* position specified. This is an integer number of characters from the beginning of the buffer. The first character position is 0 (zero).

## RELATED

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