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

# XmListReplaceItems(3)

A List function that replaces the specified elements in the list

## NAME

**XmListReplaceItems** — A List function that replaces the specified elements in the list

## SYNOPSIS

```
#include <Xm/List.h>
void XmListReplaceItems(
Widget widget,
XmString *old_items,
int item_count,
XmString *new_items);
```

## DESCRIPTION

**XmListReplaceItems** replaces each specified item of the list with a corresponding new item. When the items are inserted into the list, they are compared with the current **XmNselectedItems** list. If any of the new items matches an item on the selected list, it appears selected.

- *widget*

  Specifies the ID of the List widget.

- *old\_items*

  Specifies the items to be replaced.

- *item\_count*

  Specifies the number of items in *old\_items* and *new\_items*. This number must be nonnegative.

- *new\_items*

  Specifies the replacement items.

Every occurrence of each element of *old\_items* is replaced with the corresponding element from *new\_items*. That is, the first element of *old\_items* is replaced with the first element of *new\_items*. The second element of *old\_items* is replaced with the second element of *new\_items*, and so on until *item\_count* is reached.

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

## RELATED

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