{"id":56,"date":"2008-05-14T15:19:31","date_gmt":"2008-05-14T20:19:31","guid":{"rendered":"http:\/\/jaimerios.com\/?p=56"},"modified":"2008-05-14T15:19:31","modified_gmt":"2008-05-14T20:19:31","slug":"creating-a-nswindow-programatically-in-cocoa","status":"publish","type":"post","link":"https:\/\/jaimerios.com\/?p=56","title":{"rendered":"Creating a NSWindow programatically in Cocoa"},"content":{"rendered":"<p>Here is something that I haven&#8217;t found on the web: an example of how to create a NSWindow programatically from Cocoa. After a little bit of reading, and some head scratching, this is what I got:<\/p>\n<pre lang=\"Obj-C\">\nNSRect windowRect = NSMakeRect(10.0f, 10.0f, 800.0f, 600.0f);\n\nNSWindow *window = [[NSWindow alloc] initWithContentRect:windowRect \nstyleMask:( NSResizableWindowMask | NSClosableWindowMask | NSTitledWindowMask) \nbacking:NSBackingStoreBuffered defer:NO];\n\n[window makeKeyAndOrderFront:nil];\n\u00a0<\/pre>\n<p>There was another website where I saw some sample code that helped, so here it is:\u00a0<br \/>\n<a href=\"http:\/\/www.mp3car.com\/vbulletin\/maccar\/73352-some-cocoa-xcode-help.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.mp3car.com\/vbulletin\/maccar\/73352-some-cocoa-xcode-help.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is something that I haven&#8217;t found on the web: an example of how to create a NSWindow programatically from Cocoa. After a little bit of reading, and some head scratching, this is what I got: NSRect windowRect = NSMakeRect(10.0f, 10.0f, 800.0f, 600.0f); NSWindow *window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:( NSResizableWindowMask | NSClosableWindowMask | NSTitledWindowMask) &#8230; <a title=\"Creating a NSWindow programatically in Cocoa\" class=\"read-more\" href=\"https:\/\/jaimerios.com\/?p=56\" aria-label=\"Read more about Creating a NSWindow programatically in Cocoa\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[122,326,328,329],"class_list":["post-56","post","type-post","status-publish","format-standard","hentry","category-coding","tag-cocoa","tag-nswindow","tag-obj-c","tag-objective-c"],"_links":{"self":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=56"}],"version-history":[{"count":0,"href":"https:\/\/jaimerios.com\/index.php?rest_route=\/wp\/v2\/posts\/56\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaimerios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}