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

# XmListReplacePositions(3)

A List function that replaces items in a list based on position

## NAME

**XmListReplacePositions** — A List function that replaces items in a list based on position

## SYNOPSIS

```
#include <Xm/List.h>
void XmListReplacePositions(
Widget widget,
int *position_list,
XmString *item_list,
int item_count;);
```

## DESCRIPTION

**XmListReplacePositions** replaces noncontiguous items in a list. The item at each position specified in *position\_list* is replaced with the corresponding entry in *item\_list*. When the items are inserted into the list, they are compared with the current **XmNselectedItems** list. Any of the new items that match items on the selected list appear selected. A warning message is displayed if a specified position is invalid; that is, the value is 0 (zero), a negative integer, or a number greater than the number of items in the list.

- *widget*

  Specifies the ID of the List widget.

- *position\_list*

  Specifies an array of the positions of items to be replaced. The position of the first item in the list is 1; the position of the second item is 2; and so on.

- *item\_list*

  Specifies an array of the replacement items.

- *item\_count*

  Specifies the number of elements in *position\_list* and *item\_list*. This number must be nonnegative.

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

## RELATED

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