---
name: "SDL_InsertTrayEntryAt"
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_InsertTrayEntryAt"
---

# SDL\_InsertTrayEntryAt(3)

Insert a tray entry at a given position.

## NAME

SDL\_InsertTrayEntryAt - Insert a tray entry at a given position.

## HEADER FILE

Defined in SDL3/SDL\_tray.h

## SYNOPSIS

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

**SDL\_TrayEntry \* SDL\_InsertTrayEntryAt(SDL\_TrayMenu \*menu, int pos, const char \*label, SDL\_TrayEntryFlags flags);**

## DESCRIPTION

If label is NULL, the entry will be a separator. Many functions won't work for an entry that is a separator.

An entry does not need to be destroyed; it will be destroyed with the tray.

## FUNCTION PARAMETERS

- *menu*

  the menu to append the entry to.

- *pos*

  the desired position for the new entry. Entries at or following this place will be moved. If pos is -1, the entry is appended.

- *label*

  the text to be displayed on the entry, in UTF-8 encoding, or NULL for a separator.

- *flags*

  a combination of flags, some of which are mandatory.

## RETURN VALUE

( **SDL\_TrayEntry**\
  \*) Returns the newly created entry, or NULL if pos is out of bounds.

## 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\_TrayEntryFlags**(3type)](/SDL_TrayEntryFlags/3type.md), **•**(3), [**SDL\_GetTrayEntries**(3)](/SDL_GetTrayEntries/3.md), **•**(3), [**SDL\_RemoveTrayEntry**(3)](/SDL_RemoveTrayEntry/3.md), **•**(3), [**SDL\_GetTrayEntryParent**(3)](/SDL_GetTrayEntryParent/3.md)
