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
NSTextField* xxxUIControlCreateTextField(NSStackView* parent, const char* label, const char* default_value, u32 tag, float preferred_width, float view_width) | |
{ | |
NSStackView* stack = [[NSStackView alloc] init]; | |
stack.translatesAutoresizingMaskIntoConstraints = NO; | |
stack.orientation = NSUserInterfaceLayoutOrientationHorizontal; | |
stack.spacing = 4; | |
NSTextField* tf_label = nil; |
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
- (void)drawRect:(NSRect)dirtyRect | |
{ | |
[super drawRect:dirtyRect]; | |
static int redOffset = 0; | |
static int greenOffset = 0; | |
static int blueOffset = 0; | |
for (int y = 0; y < _bitmapHeight; y++) | |
{ |
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
NSMenu* menubar = [NSMenu new]; | |
NSMenuItem* appMenuItem = [NSMenuItem new]; | |
[menubar addItem:appMenuItem]; | |
[NSApp setMainMenu:menubar]; | |
NSMenu* appMenu = [NSMenu new]; | |
NSString* toggleFullScreenTitle = @"Toggle Full Screen"; |
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
(set popen (NuBridgedFunction functionWithName:"popen" signature:"l**")) | |
(set pclose (NuBridgedFunction functionWithName:"pclose" signature:"il")) | |
(set fgetc (NuBridgedFunction functionWithName:"fgetc" signature:"il")) | |
(set mktemp (NuBridgedFunction functionWithName:"mktemp" signature:"**")) | |
(set unlink (NuBridgedFunction functionWithName:"unlink" signature:"i*")) | |
(function sys (command) | |
(set tempfile (mktemp "temp.XXXXXX")) | |
(set c (+ "(" command " 2>&1) > " tempfile)) |
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
static IMP handler_returning_void(void* userdata) | |
{ | |
return imp_implementationWithBlock(^(id receiver, ...) { | |
struct handler_description description; | |
description.handler = NULL; | |
description.description = userdata; | |
va_list ap; | |
va_start(ap, receiver); | |
nu_handler(0, &description, receiver, ap); | |
}); |
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 path = "/Users/jsb/Desktop/LayerTest"; | |
var filename = "jefftest.acorn"; | |
var acorn = JSTalk.application("Acorn"); | |
var doc = acorn.open(path + "/" + filename); | |
var count = doc.layers().count(); | |
for (i = 0; i < count; i++) | |
{ |
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
diff --git a/objc/nu.m b/objc/nu.m | |
index 1d21a56..170206c 100644 | |
--- a/objc/nu.m | |
+++ b/objc/nu.m | |
@@ -230,6 +230,12 @@ int NuMain(int argc, const char *argv[], const char *envp[]) | |
@catch (NuException* nuException) | |
{ | |
printf("%s\n", [[nuException dump] cStringUsingEncoding:NSUTF8StringEncoding]); | |
+ if ([[nuException name] isEqualToString:@"NuUndefinedSuperclass"]) { | |
+ NSArray* a = [[nuException reason] componentsSeparatedByString:@" "]; |
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
(load "NuMongoDB") | |
(load "NuJSON") | |
(load "Nutils:cl_utils") ; for butlast and last functions | |
(load "Nutils:with_object") ; for with-object | |
; Wrap the mongo connection and make sure the last value of body is | |
; the return value | |
(macro with-mongo ((user password db) *body) | |
(set __allbutlast (butlast *body)) | |
(set __last (last *body)) |
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
(macro dbg (s) | |
`(let ((_a ,s)) | |
(print ',s) | |
(print " = ") | |
(puts _a) | |
_a)) | |
(function factorial (n) | |
(if (< n 2) | |
(then n) |
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
@interface JSBClass : NSObject | |
{ | |
int anIntArray[12]; | |
struct jsbStruct aStruct; | |
struct jsbStruct aStruct2; | |
union jsbUnion aUnion; | |
int anEnum; | |
char aChar; | |
int anInteger; | |
short aShort; |
NewerOlder