---
name: "SDL_SetTrayEntryCallback"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_SetTrayEntryCallback"
---

# SDL\_SetTrayEntryCallback(3)

Sets a callback to be invoked when the entry is selected.

## NAME

SDL\_SetTrayEntryCallback - Sets a callback to be invoked when the entry is selected.

## HEADER FILE

Defined in SDL3/SDL\_tray.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**void SDL\_SetTrayEntryCallback(SDL\_TrayEntry \*entry, SDL\_TrayCallback callback, void \*userdata);**

## FUNCTION PARAMETERS

- *entry*

  the entry to be updated.

- *callback*

  a callback to be invoked when the entry is selected.

- *userdata*

  an optional pointer to pass extra data to the callback when it will be invoked.

## THREAD SAFETY

This function should be called on the thread that created the tray.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetTrayEntries**(3)](/SDL_GetTrayEntries/3.md), **•**(3), [**SDL\_InsertTrayEntryAt**(3)](/SDL_InsertTrayEntryAt/3.md)
