sdlSetTrayTooltip function

void sdlSetTrayTooltip(
  1. Pointer<SdlTray> tray,
  2. String? tooltip
)

Updates the system tray icon's tooltip.

\param tray the tray icon to be updated. \param tooltip the new tooltip. May be NULL.

\since This function is available since SDL 3.2.0.

\sa SDL_CreateTray

extern SDL_DECLSPEC void SDLCALL SDL_SetTrayTooltip(SDL_Tray *tray, const char *tooltip)

Implementation

void sdlSetTrayTooltip(Pointer<SdlTray> tray, String? tooltip) {
  final sdlSetTrayTooltipLookupFunction = libSdl3.lookupFunction<
      Void Function(Pointer<SdlTray> tray, Pointer<Utf8> tooltip),
      void Function(
          Pointer<SdlTray> tray, Pointer<Utf8> tooltip)>('SDL_SetTrayTooltip');
  final tooltipPointer = tooltip != null ? tooltip.toNativeUtf8() : nullptr;
  final result = sdlSetTrayTooltipLookupFunction(tray, tooltipPointer);
  calloc.free(tooltipPointer);
  return result;
}