OSDN Git Service

SDL_CreateThread サンプルコードを修正 https://wiki.libsdl.org/SDL_CreateThread?action=diff...
[sdl2referencejp/sdl2referencejp.git] / SDL_ShowMessageBox.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
2 <html lang="ja-JP">\r
3 <head>\r
4 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">\r
5 <meta http-equiv="Content-Style-Type" content="text/css">\r
6 <meta name="keywords" content="Simple Directmedia Layer SDL2.0">\r
7 <link rel="top" href="index.html" title="\83z\81[\83\80">\r
8 <link rel="parent" href="CategoryVideo.html" title="1\82Â\8fã">\r
9 <title>SDL_ShowMessageBox</title>\r
10 </head>\r
11 <body>\r
12 <a href="index.html">\96Ú\8e\9f</a> - <a href="ApiByCategory.html">API(\8b@\94\\95Ê)</a> - <a href="CategoryVideo.html">\83f\83B\83X\83v\83\8c\83C\82Æ\83E\83B\83\93\83h\83E</a> - SDL_ShowMessageBox\r
13 <hr>\r
14 <h1>SDL_ShowMessageBox</h1>\r
15 \83\82\81[\83_\83\8b\82È\83\81\83b\83Z\81[\83W\83{\83b\83N\83X\82ð\90\90¬\82·\82é\r
16 <h2>\8d\\95¶</h2>\r
17 <code>int SDL_ShowMessageBox(const SDL_MessageBoxData* messageboxdata, int* buttonid)</code>\r
18 <h2>\88ø\90\94</h2>\r
19 <table border="1" summary="SDL_ShowMessageBox">\r
20 <tr><td>messageboxdata</td><td>\83^\83C\83g\83\8b\83e\83L\83X\83g, \82»\82Ì\91¼\82Ì\83I\83v\83V\83\87\83\93\82ð\8aÜ\82Þ<a href="SDL_MessageBoxData.html">SDL_MessageBoxData</a></td></tr>\r
21 <tr><td>buttonid</td><td>\83\86\81[\83U\82ª\89\9f\82µ\82½\83{\83^\83\93\82ÌID\82ð\91ã\93ü\82·\82é\83|\83C\83\93\83^</td></tr>\r
22 </table>\r
23 <h2>\96ß\82è\92l</h2>\r
24 \90¬\8c÷\82Ì\82Æ\82«0, \8e¸\94s\82Ì\82Æ\82«\95\89\82Ì\90\94\82Ì\83G\83\89\81[\83R\81[\83h\82ð\96ß\82·.\r
25 <a href="SDL_GetError.html">SDL_GetError()</a>\82ð\8cÄ\82ñ\82Å\8fÚ\8d×\82ð\92m\82é\82±\82Æ\82ª\82Å\82«\82é.\r
26 <h2>\83T\83\93\83v\83\8b\83R\81[\83h</h2>\r
27 <p>\r
28 <code>\r
29 <pre>\r
30 #include "SDL.h"\r
31 \r
32 int main(int argc, char *argv[])\r
33 {\r
34     const SDL_MessageBoxButtonData buttons[] = {\r
35         { /* .flags, .buttonid, .text */        0, 0, "\82¢\82¢\82¦" },\r
36         { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, 1, "\82Í\82¢" },\r
37         { SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, 2, "\83L\83\83\83\93\83Z\83\8b" },\r
38     };\r
39     const SDL_MessageBoxColorScheme colorScheme = {\r
40         { /* .colors (.r, .g, .b) */\r
41             /* [SDL_MESSAGEBOX_COLOR_BACKGROUND] */\r
42             { 255,   0,   0 },\r
43             /* [SDL_MESSAGEBOX_COLOR_TEXT] */\r
44             {   0, 255,   0 },\r
45             /* [SDL_MESSAGEBOX_COLOR_BUTTON_BORDER] */\r
46             { 255, 255,   0 },\r
47             /* [SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND] */\r
48             {   0,   0, 255 },\r
49             /* [SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED] */\r
50             { 255,   0, 255 }\r
51         }\r
52     };\r
53     const SDL_MessageBoxData messageboxdata = {\r
54         SDL_MESSAGEBOX_INFORMATION, /* .flags */\r
55         NULL, /* .window */\r
56         "\83\81\83b\83Z\81[\83W\83{\83b\83N\83X\82Ì\83T\83\93\83v\83\8b", /* .title */\r
57         "\83{\83^\83\93\82ð\91I\91ð\82µ\82Ä\82­\82¾\82³\82¢", /* .message */\r
58         SDL_arraysize(buttons), /* .numbuttons */\r
59         buttons, /* .buttons */\r
60         &amp;colorScheme /* .colorScheme */\r
61     };\r
62     int buttonid;\r
63     if (SDL_ShowMessageBox(&amp;messageboxdata, &amp;buttonid) &lt; 0) {\r
64         SDL_Log("\83\81\83b\83Z\81[\83W\83{\83b\83N\83X\82Ì\95\\8e¦\82É\8e¸\94s\82µ\82½");\r
65         return 1;\r
66     }\r
67     if (buttonid == -1) {\r
68         SDL_Log("\91I\91ð\82³\82ê\82È\82©\82Á\82½");\r
69     } else {\r
70        SDL_Log("%s\82ª\91I\91ð\82³\82ê\82½", buttons[buttonid].text);\r
71     }\r
72     return 0;\r
73 }\r
74 </pre>\r
75 </code>\r
76 </p>\r
77 <h2>\8fÚ\8d×</h2>\r
78 \82±\82Ì\8aÖ\90\94\82Í, \90e\83E\83B\83\93\83h\83E\82ª\90\90¬\82³\82ê\82½\83X\83\8c\83b\83h, \90e\83E\83B\83\93\83h\83E\82ª\82È\82¯\82ê\82Î\83\81\83C\83\93\83X\83\8c\83b\83h\82Å\8cÄ\82Ô\95K\97v\82ª\82 \82é.\r
79 \83\86\81[\83U\82ª\83{\83^\83\93\82ð\89\9f\82·, \82Ü\82½\82Í\83\81\83b\83Z\81[\83W\83{\83b\83N\83X\82ð\95Â\82\82é\82Ü\82Å\83X\83\8c\83b\83h\82Ì\8eÀ\8ds\82Í\92â\8e~\82³\82ê\82é.\r
80 <h2>\83o\81[\83W\83\87\83\93</h2>\r
81 SDL 2.0.0\88È\8d~\r
82 <h2>\8aÖ\98A\8d\80\96Ú(\8aÖ\90\94)</h2>\r
83 <a href="SDL_ShowSimpleMessageBox.html">SDL_ShowSimpleMessageBox</a><br>\r
84 <h2>SDL Wiki\82Ö\82Ì\83\8a\83\93\83N</h2>\r
85 <a href="https://wiki.libsdl.org/SDL_ShowMessageBox">SDL_ShowMessageBox - SDL Wiki</a>\r
86 <hr>\r
87 </body>\r
88 </html>\r