Created
September 5, 2011 03:37
-
-
Save TooTallNate/1194032 to your computer and use it in GitHub Desktop.
Creating a Cocoa GUI window with NodObjC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $ = require('./') | |
$.import('Foundation') | |
$.import('Cocoa') | |
var pool = $.NSAutoreleasePool('alloc')('init') | |
var app = $.NSApplication('sharedApplication') | |
var style = $.NSClosableWindowMask | $.NSResizableWindowMask | |
| $.NSTexturedBackgroundWindowMask | $.NSTitledWindowMask | |
| $.NSMiniaturizableWindowMask | |
var rect = $.NSMakeRect(50, 50, 600, 400) | |
var win = $.NSWindow('alloc')('initWithContentRect', rect | |
, 'styleMask', style | |
, 'backing', $.NSBackingStoreBuffered | |
, 'defer', 0) | |
win('makeKeyAndOrderFront', win) | |
app('run') | |
pool('release') |
I just got it working - was a problem with my node installation (
http://stackoverflow.com/questions/7437447/how-to-build-and-install-node-js-on-osx-from-git-clone/7438098#7438098)
which I solved by completely removing it, the re-installing everything.
After that - I had to install NodObjC twice (once before all the other
modules like express etc...) - both times with success message, then it all
works fine. Hello world and cocoa.
Happy days.
Thanks a bunch for your help. This is a very exciting project. Javascript is
appearing everywhere now - I really like it.
Cheers
Billy
…On Fri, Sep 16, 2011 at 12:59 AM, Nathan Rajlich < ***@***.***>wrote:
@billymoon Come to IRC room `#nodobjc` on Freenode and I can help walk you
through it.
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/1194032
Well glad you got it figured out :)
On Thu, Sep 15, 2011 at 3:34 PM, billymoon <
[email protected]>wrote:
… I just got it working - was a problem with my node installation (
http://stackoverflow.com/questions/7437447/how-to-build-and-install-node-js-on-osx-from-git-clone/7438098#7438098
)
which I solved by completely removing it, the re-installing everything.
After that - I had to install NodObjC twice (once before all the other
modules like express etc...) - both times with success message, then it all
works fine. Hello world and cocoa.
Happy days.
Thanks a bunch for your help. This is a very exciting project. Javascript
is
appearing everywhere now - I really like it.
Cheers
Billy
On Fri, Sep 16, 2011 at 12:59 AM, Nathan Rajlich <
***@***.***>wrote:
> @billymoon Come to IRC room `#nodobjc` on Freenode and I can help walk
> you
> through it.
> ##
>
> Reply to this email directly or view it on GitHub:
> https://gist.github.com/1194032
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/1194032
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@billymoon Come to IRC room
#nodobjc
on Freenode and I can help walk you through it.