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

# XmListGetSelectedPos(3)

A List function that returns the position of every selected item in the list

## NAME

**XmListGetSelectedPos** — A List function that returns the position of every selected item in the list

## SYNOPSIS

```
#include <Xm/List.h>
Boolean XmListGetSelectedPos(
Widget widget,
int **position_list,
int *position_count);
```

## DESCRIPTION

This routine is obsolete. It is replaced by calling **XtGetValues** for the List resources **XmNselectedPositions** and **XmNselectedPositionCount**. **XmListGetSelectedPos** is a Boolean function that returns an array of the positions of the selected items in a List.

- *widget*

  Specifies the ID of the List widget.

- *position\_list*

  Returns an array of the positions of the selected items in the List. The position of the first item in the list is 1; the position of the second item is 2; and so on. When the return value is True, **XmListGetSelectedPos** allocates memory for this array. The caller is responsible for freeing this memory. The caller can recover the allocated memory by calling **XtFree**.

- *position\_count*

  Returns the number of elements in the *position\_list*.

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

## RETURN

Returns True if the list has any selected items, and False if it does not.

## RELATED

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