= Window Management
* ((<Window Management Overview>))
* ((<Methods for Window Management>))
TOC

== Window Management Overview
SDL provides a small set of window management functions
which allow applications to change their title and toggle
from windowed mode to fullscreen (if available)

== Methods for Window Management
%%%
NAME caption
MOD WM
TYPE .
PURPOSE Gets the window title and icon name.
RVAL [String, String]

PROTO
caption

DESC
Returns the window title and icon name as an array with two element.

SEEALSO
WM.set_caption

%%
NAME set_caption
MOD WM
TYPE .
PURPOSE Sets the window tile and icon name.

PROTO
set_caption(title, icon)
setCaption(title, icon)

DESC
Sets the title-bar and icon name of the display window.

NOTES
$[title] and $[icon] must be UTF8 or ASCII string.

If Ruby/SDL m17n support is enabled, 
$[title] and $[icon] are converted to UTF8 automatically.

SEEALSO
WM.caption
WM.icon=

%%
NAME icon=
MOD WM
TYPE .
PURPOSE Sets the icon for the display window.

PROTO
icon=(icon_image)

DESC
Sets the icon for the display window. Win32 icons must be 32x32.

This function must be called before the first call to 
@[Screen.open].
$[icon_image] should be an instance of @[Surface]

EXAMPLE
SDL::WM.icon = SDL::Surface.load_bmp("icon.bmp")

SEEALSO
set_video_mode
WM.caption

%%
NAME iconify
MOD WM
TYPE .
PURPOSE Iconify/Minimise the window

PROTO
iconify

DESC
If the application is running in a window managed environment
SDL attempts to iconify/minimise
it. If this method is successful,
the application will receive a @[Event::APPACTIVE]
loss event.

EXCEPTION *

%%
NAME grab_input
MOD WM
TYPE .
PURPOSE Grabs mouse and keyboard input.
RVAL Integer

PROTO
grab_input(mode)
grabInput(mode)

DESC
Grabbing means that the mouse is confined to the application window,
and nearly all keyboard input is passed directly to the application,
and not interpreted by a window manager, if any.

You can use following three constants as $[mode].
* SDL::WM::GRAB_QUERY
* SDL::WM::GRAB_OFF
* SDL::WM::GRAB_ON

When $[mode] is SDL::WM::GRAB_QUERY, 
the grab mode is not changed, but the current grab mode is returned.

RET
Returns the current/new mode.

