1 USING: cocoa cocoa.messages cocoa.subclassing cocoa.types
2 compiler.test kernel namespaces cocoa.classes cocoa.runtime
3 tools.test memory compiler.units math core-graphics.types ;
4 FROM: alien.c-types => int void ;
9 METHOD: void foo: NSRect rect [
16 dup 1.0 2.0 101.0 102.0 <CGRect> -> foo:
21 [ 1.0 ] [ "x" get CGRect-x ] unit-test
22 [ 2.0 ] [ "x" get CGRect-y ] unit-test
23 [ 101.0 ] [ "x" get CGRect-w ] unit-test
24 [ 102.0 ] [ "x" get CGRect-h ] unit-test
28 METHOD: NSRect bar [ test-foo "x" get ]
37 [ 1.0 ] [ "x" get CGRect-x ] unit-test
38 [ 2.0 ] [ "x" get CGRect-y ] unit-test
39 [ 101.0 ] [ "x" get CGRect-w ] unit-test
40 [ 102.0 ] [ "x" get CGRect-h ] unit-test
42 ! Make sure that we can add methods
45 METHOD: NSRect bar [ test-foo "x" get ]
47 METHOD: int babb: int x [ x sq ]