Create a window group that other windows can join
#include <screen/screen.h>
int screen_create_window_group(screen_window_t win, const char *name)
Function Type: Delayed Execution
This function creates a window group and assigns it to the specified window. The group is identified by the name string, which must be unique. The request fails if another group was previously created with the same name.
Windows can parent only one group. Therefore, screen_create_window_group() can be called successfully only once for any given window. Additionally, only windows of certain types can parent a group of windows. Windows with a type of SCREEN_APPLICATION_WINDOW can parent windows of type SCREEN_CHILD_WINDOW and SCREEN_EMBEDDED_WINDOW. Windows with a type of SCREEN_CHILD_WINDOW can also create a group and parent windows of type SCREEN_EMBEDDED_WINDOW.
Once a group is created, it exists until the window that parents the group is destroyed. When a parent window is destroyed, all children are orphaned and made invisible. Destroying a child has no effect on the group other than removing the window from the group.
Group owners have privileged access to the windows that they parent. When windows join the group, the parent receives a SCREEN_EVENT_CREATE event that contains a handle to the child window that can be used by the parent to set properties or send events. Conversely, the parent gets notified when a child window gets destroyed. The parent window is expected to destroy its local copy of the window handle when one of its children is destroyed.
Call screen_destroy_group() when you no longer need the window group. Note the screen_group_t handle required by screen_destroy_group() can be obtained by calling screen_get_window_property_pv().
0 if successful, or -1 if an error occurred (errno is set; refer to errno.h for more details).