-
-
Save TooTallNate/1194032 to your computer and use it in GitHub Desktop.
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 get an error myself
File contents...
var $ = require('NodObjC')
$.import('Foundation')
$.import('Cocoa')
var pool = $.NSAutoreleasePool('alloc')('init')
var app = $.NSApplication('sharedApplication')
var style =
|
| $.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')
output from command: node cocoa-gui
Segmentation fault
bash-3.2$
I would love to get this cocoa working with node - but can't seem to get any of it to work. Any idea what a Segmentation fault is, what causes it?
@billymoon Which node version? I seem to have the most luck on v0.5.5
. Also does even the hello world example in the README work?
Oh I see what's going on. You're on [email protected]
. That version doesn't have a lot of the good stuff. I just published v0.0.7
which gives support back for node 0.4.x. So re-run npm install NodObjC
and let me know how it goes.
@billymoon Come to IRC room #nodobjc
on Freenode and I can help walk you through it.
Results in: