Skip to content

Instantly share code, notes, and snippets.

//
// main.j
import <Foundation/Foundation.j>
import <AppKit/AppKit.j>
@implementation CPDictionary (CPKeyValueCoding)
- (id)valueForKey:(CPString)key
var string = @"/a/b";
var selector = @selector(lastPathComponent);
var invocation = [CPInvocation invocationWithMethodSignature:nil];
[invocation setTarget:string];
[invocation setSelector:selector];
var result = [invocation invoke];
CPLogConsole("RESULT = "+ result);
var string = @"/a/b";
var selector = @selector(lastPathComponent);
var invocation = [CPInvocation invocationWithMethodSignature:nil];
[invocation setTarget:string];
[invocation setSelector:selector];
var result = [invocation invoke];
CPLogConsole("RESULT = "+ result);
Statically Preprocessing AppKit.j
Compacting /Volumes/GAMMA/DEVELOPPEMENT/BUILDS/CAPPUCCINO/Release/AppKit
cp -r /Volumes/GAMMA/DEVELOPPEMENT/BUILDS/CAPPUCCINO/Release/AppKit/. /Volumes/GAMMA/DEVELOPPEMENT/BUILDS/CAPPUCCINO/Release/env/lib/Frameworks/AppKit
js: "/Volumes/GAMMA/DEVELOPPEMENT/BUILDS/CAPPUCCINO/Release/env/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2422(eval)", line 86: uncaught JavaScript runtime exception: ReferenceError: "CPPopUpButton" n'est pas dŽfini
at /Volumes/GAMMA/DEVELOPPEMENT/BUILDS/CAPPUCCINO/Release/env/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2422(eval):86 ($AristoThemeDescriptor__themedPopUpButton)
at /Volumes/GAMMA/DEVELOPPEMENT/BUILDS/CAPPUCCINO/Release/env/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2422(eval):80
at /Volumes/GAMMA/DEVELOPPEMENT/BUILDS/CAPPUCCINO/Release/env/narwhal/packages/objj/lib/objj/objj.js#20(eval)#2422(eval):68
at /Volumes/GAMMA/DEVELOPPEMENT/BUILDS/CAPPUCCINO/Release/env/narwhal/packages/objj/lib/objj/obj
Statically Preprocessing CPMenuItem.j
Statically Preprocessing CPOpenPanel.j
Statically Preprocessing CPOutlineView.j
Statically Preprocessing CPPanel.j
Statically Preprocessing CPPasteboard.j
Statically Preprocessing CPPopUpButton.j
Exception in thread "main" java.lang.RuntimeException
at org.dojotoolkit.shrinksafe.Compressor.compress(Compressor.java:551)
at org.dojotoolkit.shrinksafe.Compressor.compressScript(Compressor.java:727)
at org.dojotoolkit.shrinksafe.Main.processFiles(Main.java:191)
@implementation AppController : CPObject
{
var theWindow;
var menu;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
theWindow = [[MyWindow alloc] initWithContentRect:CGRectMake(50,50,500,500) styleMask:CPResizableWindowMask],
contentView = [theWindow contentView];
@implementation CPArray (MoveIndexes)
- (void)moveIndexes:(CPIndexSet)indexes toIndex:(int)insertIndex
{
var aboveCount = 0,
object,
removeIndex;
var index = [indexes lastIndex];
@import "CPObject.j"
@import "CPString.j"
@import "CPDate.j"
@import "CPDictionary.j"
@import "CPBundle.j"
@import "CPException.j"
@import "CPKeyedArchiver.j"
@import "CPKeyedUnarchiver.j"
@import <AppKit/CPCookie.j>
- (void)drawRect:(CGRect)rect
{
var ctx = [[CPGraphicsContext currentContext] graphicsPort];
CGContextSetFillColor(ctx, [CPColor redColor]);
var path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL, 50,50);
CGPathAddLineToPoint(path, NULL, 50,150);
CGPathAddLineToPoint(path, NULL, 150,150);
- (void)drawRect:(CGRect)rect
{
var ctx = [[CPGraphicsContext currentContext] graphicsPort];
CGContextSetFillColor(ctx, [CPColor redColor]);
var path = CGPathCreateMutable();
CGPathAddRect(path,NULL,CGRectMake(10,10,50,50));
CGContextAddPath(ctx, path);
CGContextFillPath(ctx);