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:
19 [ ] [ test-foo ] unit-test
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 ]
39 [ 1.0 ] [ "x" get CGRect-x ] unit-test
40 [ 2.0 ] [ "x" get CGRect-y ] unit-test
41 [ 101.0 ] [ "x" get CGRect-w ] unit-test
42 [ 102.0 ] [ "x" get CGRect-h ] unit-test
44 ! Make sure that we can add methods
47 METHOD: NSRect bar [ test-foo "x" get ]
49 METHOD: int babb: int x [ x sq ]