sdlSetTrayTooltip function tray

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 in UTF-8 encoding. May be NULL.

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

\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 = _libSdl
      .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;
}