1 USING: alien.c-types cocoa cocoa.classes cocoa.subclassing
2 cocoa.types compiler.test core-graphics.types kernel math memory
3 namespaces tools.test ;
7 METHOD: void foo: NSRect rect [
14 dup 1.0 2.0 101.0 102.0 <CGRect> -> foo:
17 { } [ test-foo ] unit-test
19 { 1.0 } [ "x" get CGRect-x ] unit-test
20 { 2.0 } [ "x" get CGRect-y ] unit-test
21 { 101.0 } [ "x" get CGRect-w ] unit-test
22 { 102.0 } [ "x" get CGRect-h ] unit-test
24 <CLASS: Bar < NSObject
25 METHOD: NSRect bar [ test-foo "x" get ] ;
36 { 1.0 } [ "x" get CGRect-x ] unit-test
37 { 2.0 } [ "x" get CGRect-y ] unit-test
38 { 101.0 } [ "x" get CGRect-w ] unit-test
39 { 102.0 } [ "x" get CGRect-h ] unit-test
41 ! Make sure that we can add methods
42 <CLASS: Bar < NSObject
43 METHOD: NSRect bar [ test-foo "x" get ] ;
45 METHOD: int babb: int x [ x sq ] ;