1 USING: cocoa cocoa.messages cocoa.subclassing cocoa.types
2 compiler kernel namespaces cocoa.classes cocoa.runtime
3 tools.test memory compiler.units math core-graphics.types ;
4 FROM: alien.c-types => int void ;
8 { +superclass+ "NSObject" }
19 dup 1.0 2.0 101.0 102.0 <CGRect> -> foo:
24 [ 1.0 ] [ "x" get CGRect-x ] unit-test
25 [ 2.0 ] [ "x" get CGRect-y ] unit-test
26 [ 101.0 ] [ "x" get CGRect-w ] unit-test
27 [ 102.0 ] [ "x" get CGRect-h ] unit-test
30 { +superclass+ "NSObject" }
36 [ 2drop test-foo "x" get ]
45 [ 1.0 ] [ "x" get CGRect-x ] unit-test
46 [ 2.0 ] [ "x" get CGRect-y ] unit-test
47 [ 101.0 ] [ "x" get CGRect-w ] unit-test
48 [ 102.0 ] [ "x" get CGRect-h ] unit-test
50 ! Make sure that we can add methods
52 { +superclass+ "NSObject" }
58 [ 2drop test-foo "x" get ]