1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
= 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.
|