sdlCreatePopupWindow function

Pointer<SdlWindow> sdlCreatePopupWindow(
  1. Pointer<SdlWindow> parent,
  2. int offsetX,
  3. int offsetY,
  4. int w,
  5. int h,
  6. int flags,
)

Create a child popup window of the specified parent window.

The flags parameter must contain at least one of the following:

  • SDL_WINDOW_TOOLTIP: The popup window is a tooltip and will not pass any input events.
  • SDL_WINDOW_POPUP_MENU: The popup window is a popup menu. The topmost popup menu will implicitly gain the keyboard focus.

The following flags are not relevant to popup window creation and will be ignored:

  • SDL_WINDOW_MINIMIZED
  • SDL_WINDOW_MAXIMIZED
  • SDL_WINDOW_FULLSCREEN
  • SDL_WINDOW_BORDERLESS

The following flags are incompatible with popup window creation and will cause it to fail:

  • SDL_WINDOW_UTILITY
  • SDL_WINDOW_MODAL

The parent parameter must be non-null and a valid window. The parent of a popup window can be either a regular, toplevel window, or another popup window.

Popup windows cannot be minimized, maximized, made fullscreen, raised, flash, be made a modal window, be the parent of a toplevel window, or grab the mouse and/or keyboard. Attempts to do so will fail.

Popup windows implicitly do not have a border/decorations and do not appear on the taskbar/dock or in lists of windows such as alt-tab menus.

If a parent window is hidden or destroyed, any child popup windows will be recursively hidden or destroyed as well. Child popup windows not explicitly hidden will be restored when the parent is shown.

\param parent the parent of the window, must not be NULL. \param offset_x the x position of the popup window relative to the origin of the parent. \param offset_y the y position of the popup window relative to the origin of the parent window. \param w the width of the window. \param h the height of the window. \param flags SDL_WINDOW_TOOLTIP or SDL_WINDOW_POPUP_MENU, and zero or more additional SDL_WindowFlags OR'd together. \returns the window that was created or NULL on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.1.3.

\sa SDL_CreateWindow \sa SDL_CreateWindowWithProperties \sa SDL_DestroyWindow \sa SDL_GetWindowParent

extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *parent, int offset_x, int offset_y, int w, int h, SDL_WindowFlags flags)

Implementation

Pointer<SdlWindow> sdlCreatePopupWindow(Pointer<SdlWindow> parent, int offsetX,
    int offsetY, int w, int h, int flags) {
  final sdlCreatePopupWindowLookupFunction = libSdl3.lookupFunction<
      Pointer<SdlWindow> Function(Pointer<SdlWindow> parent, Int32 offsetX,
          Int32 offsetY, Int32 w, Int32 h, Uint64 flags),
      Pointer<SdlWindow> Function(Pointer<SdlWindow> parent, int offsetX,
          int offsetY, int w, int h, int flags)>('SDL_CreatePopupWindow');
  return sdlCreatePopupWindowLookupFunction(
      parent, offsetX, offsetY, w, h, flags);
}