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

# XmAddProtocolCallback(3)

A VendorShell function that adds client callbacks for a protocol

## NAME

**XmAddProtocolCallback** — A VendorShell function that adds client callbacks for a protocol

## SYNOPSIS

```
#include <Xm/Protocols.h>
void XmAddProtocolCallback(
Widget shell,
Atom property,
Atom protocol,
XtCallbackProc callback,
XtPointer closure);
```

## DESCRIPTION

**XmAddProtocolCallback** adds client callbacks for a protocol. It checks if the protocol is registered, and if it is not, calls **XmAddProtocols**. It then adds the callback to the internal list. These callbacks are called when the corresponding client message is received.

**XmAddWMProtocolCallback** is a convenience interface. It calls **XmAddProtocolCallback** with the property value set to the atom returned by interning **WM\_PROTOCOLS**.

- *shell*

  Specifies the widget with which the protocol property is associated

- *property*

  Specifies the protocol property

- *protocol*

  Specifies the protocol **Atom**

- *callback*

  Specifies the procedure to call when a protocol message is received

- *closure*

  Specifies the client data to be passed to the callback when it is invoked

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

## RELATED

[**VendorShell**(3)](/VendorShell/3.md), [**XmAddWMProtocolCallback**(3)](/XmAddWMProtocolCallback/3.md), [**XmInternAtom**(3)](/XmInternAtom/3.md), and [**XmRemoveProtocolCallback**(3)](/XmRemoveProtocolCallback/3.md).
