Create a child window
You can use the screen_create_window_type() function to create a child window.
To create a child window:
Create a variable for each of the context and window instances.
screen_context_t screen_context = 0; screen_window_t screen_child_window = 0;
Create a context. The context describes the relationship between the
application and the underlying windowing system.
Create a child window. The screen_create_window_type()
function takes the window and context variables and an integer representing the
window type. In this case, the window is of type
int wintype = SCREEN_CHILD_WINDOW; screen_create_window_type(&screen_child_window, screen_context, wintype);
Join a window group. The window_group_name
must be the name of the
window group created by the parent (or main) window through the screen_create_window_group() function.
Although any instances created are destroyed when the application exits, it is best practice to destroy any window and context instances that you created but no longer require. In some cases you must destroy windows and contexts. For example, when an app outlasts the lifespan of contexts and windows without destroying the process, then you must call the appropriate destroy functions.
In this example, you should destroy the window and the context once you have finished using them.
Last modified: 2015-03-31