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

# XmTextSetHighlight(3)

A Text function that highlights text

## NAME

**XmTextSetHighlight** — A Text function that highlights text

## SYNOPSIS

```
#include <Xm/Text.h>
void XmTextSetHighlight(
Widget widget,
XmTextPosition left,
XmTextPosition right,
XmHighlightMode mode);
```

## DESCRIPTION

**XmTextSetHighlight** highlights text between the two specified character positions. The *mode* parameter determines the type of highlighting. Highlighting text merely changes the visual appearance of the text; it does not set the selection.

- *widget*

  Specifies the Text widget ID

- *left*

  Specifies the position of the left boundary of text to be highlighted. This is an integer number of characters from the beginning of the text buffer. The first character position is 0 (zero).

- *right*

  Specifies the position of the right boundary of text to be highlighted. This is an integer number of characters from the beginning of the text buffer. The first character position is 0 (zero).

- *mode*

  Specifies the type of highlighting to be done. A value of **XmHIGHLIGHT\_NORMAL** removes highlighting. A value of **XmHIGHLIGHT\_SELECTED** highlights the text using reverse video. A value of **XmHIGHLIGHT\_SECONDARY\_SELECTED** highlights the text using underlining.

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

## RELATED

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