-
Notifications
You must be signed in to change notification settings - Fork 56
MTY_WindowCreate
Create an MTY_Window
, the primary interactive view of an application.
An MTY_Window
is a child of the MTY_App
object, so everywhere a window is referenced the MTY_App
comes along with it. All functions taking an MTY_Window
as an argument are designed to handle invalid windows, which are integers.
MTY_Window MTY_WindowCreate(
MTY_App * app,
const char * title,
const MTY_Frame * frame,
MTY_Window index
);
app
(MTY_App *
)
The MTY_App
.
title
(const char *
)
The title of the window.
frame
(const MTY_Frame *
)
The window's size and position. Use MTY_MakeDefaultFrame
or MTY_WindowGetFrame
to fill a frame more precisely. This function expects unscaled values. May be NULL
for sensible defaults.
index
(MTY_Window
)
Attempt to create the window with the specified index. If the index is already taken, the first available is used.
On success, a value between 0 and MTY_WINDOW_MAX
is returned.
On failure, -1 is returned. Call MTY_GetLog
for details.
The returned MTY_Window
may be destroyed with MTY_WindowDestroy
, or destroyed during MTY_AppDestroy
which destroys all windows.