{"id":5931,"date":"2016-05-21T19:16:01","date_gmt":"2016-05-21T10:16:01","guid":{"rendered":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5931"},"modified":"2016-05-21T19:39:43","modified_gmt":"2016-05-21T10:39:43","slug":"osx-%e3%81%a7%e3%82%a2%e3%83%a9%e3%83%bc%e3%83%88%e3%83%80%e3%82%a4%e3%82%a2%e3%83%ad%e3%82%b0%e3%82%92%e5%87%ba%e3%81%99%e3%81%a0%e3%81%91%e3%81%ae%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%a0","status":"publish","type":"post","link":"http:\/\/umezawa.dyndns.info\/wordpress\/?p=5931","title":{"rendered":"OSX \u3067\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059\u3060\u3051\u306e\u30d7\u30ed\u30b0\u30e9\u30e0"},"content":{"rendered":"<p>OSX \u3067\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\uff08Windows \u3067\u8a00\u3046\u6240\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u30dc\u30c3\u30af\u30b9\uff09\u3092\u51fa\u3059\u3060\u3051\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3053\u3046\u3068\u601d\u3063\u305f\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u3061\u306a\u307f\u306b Windows \u3067 Win32 API \u3092\u76f4\u63a5\u89e6\u308b\u5834\u5408\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3042\u308b\u3002<\/p>\n<blockquote>\n<pre>#include &lt;windows.h&gt;\r\n\r\nint WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)\r\n{\r\n    int ret;\r\n    ret = MessageBox(NULL, \"Are you sure?\", \"MessageBox Test\",\r\n                     MB_ICONWARNING | MB_YESNO);\r\n    if (ret == MBYES)\r\n        ....\r\n    return 0;\r\n}<\/pre>\n<\/blockquote>\n<p>\u4f55\u3057\u308d OSX \u3067 GUI \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3057\u305f\u3053\u3068\u306a\u3044\u306e\u3067\u3001Windows \u3067\u8a00\u3046\u6240\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u30eb\u30fc\u30d7\u306e\u66f8\u304d\u65b9\u3068\u304b\u305d\u3046\u3044\u3063\u305f\u76f4\u63a5\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059\u90e8\u5206\u4ee5\u5916\u306e\u8a18\u8ff0\u65b9\u6cd5\u304c\u5206\u304b\u3089\u306a\u3044\u306e\u3060\u3051\u3069\u3001\u3068\u308a\u3042\u3048\u305a\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u30c4\u30fc\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u3063\u3066\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3092\u66f8\u3044\u3066\u307f\u305f\u3089\u3046\u307e\u304f\u3044\u3063\u305f\u3088\u3046\u306b\u898b\u3048\u308b\u3002ObjC \u3067\u306f\u306a\u304f Swift \u3067\u3042\u308b\uff08\u4eca\u66f4 ObjC \u306a\u3069\u4f7f\u3044\u305f\u304f\u306a\u3044\uff09<\/p>\n<blockquote>\n<pre>\/\/ import Foundation \/\/ \u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059\u3060\u3051\u306a\u3089\u8981\u3089\u306a\u3044\u3089\u3057\u3044\r\nimport Cocoa\r\n\r\nlet alert = NSAlert();\r\nalert.messageText = \"Alert Test\"\r\nalert.informativeText = \"Are you sure?\"\r\nalert.alertStyle = NSAlertStyle.WarningAlertStyle\r\nalert.addButtonWithTitle(\"Yes\")\r\nalert.addButtonWithTitle(\"No\")\r\nlet ret = alert.runModal();\r\nif ret == NSAlertFirstButtonReturn {\r\n    ....\r\n}\r\n<\/pre>\n<\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/umezawa.dyndns.info\/wordpress\/wp-content\/uploads\/2016\/05\/osx-alertdialog.png\" alt=\"OSX \u306e \u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\" width=\"448\" height=\"182\" class=\"alignnone size-full wp-image-5933\" \/><\/p>\n<p>\u3061\u306a\u307f\u306b NSAlert \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u518d\u5229\u7528\u3067\u304d\u308b\u3089\u3057\u3044\uff08\u5358\u4e00\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u4f55\u5ea6\u3067\u3082 runModal \u3092\u547c\u3079\u308b\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OSX \u3067\u30a2\u30e9\u30fc\u30c8\u30c0\u30a4\u30a2\u30ed\u30b0\uff08Windows \u3067\u8a00\u3046\u6240\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u30dc\u30c3\u30af\u30b9\uff09\u3092\u51fa\u3059\u3060\u3051\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u3053\u3046\u3068\u601d\u3063\u305f\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-5931","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5931"}],"version-history":[{"count":5,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5931\/revisions"}],"predecessor-version":[{"id":5937,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/5931\/revisions\/5937"}],"wp:attachment":[{"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5931"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/umezawa.dyndns.info\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}