logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_SetWindowParent - Set the window as a child of a parent window.

Availability

       This function is available since SDL 3.2.0.

Description

       If the window is already the child of an existing window, it will be reparented to the new owner. Setting
       the parent window to NULL unparents the window and removes child window status.

       If  a  parent  window is hidden or destroyed, the operation will be recursively applied to child windows.
       Child windows hidden with the parent that did not  have  their  hidden  status  explicitly  set  will  be
       restored when the parent is shown.

       Attempting  to  set  the  parent  of  a  window  that  is  currently  in  the  modal state will fail. Use
       SDL_SetWindowModal() to cancel the modal status before attempting to change the parent.

       Popup windows cannot change parents and attempts to do so will fail.

       Setting a parent window that is currently the sibling or  descendent  of  the  child  window  results  in
       undefined behavior.

Function Parameters

window the window that should become the child of a parent.

       parent the new parent window for the child window.

Name

       SDL_SetWindowParent - Set the window as a child of a parent window.

Return Value

       for more information.

See Also

SDL_SetWindowModal(3)

Simple Directmedia Layer                           SDL 3.2.20                             SDL_SetWindowParent(3)

Synopsis

#include<SDL3/SDL_video.h>boolSDL_SetWindowParent(SDL_Window*window,SDL_Window*parent);

Thread Safety

       This function should only be called on the main thread.

See Also