2009-09-07 18:59:34 -04:00
|
|
|
! Copyright (C) 2009 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
USING: accessors classes.struct cocoa cocoa.classes
|
|
|
|
cocoa.subclassing core-graphics.types kernel math ;
|
|
|
|
IN: tools.deploy.test.14
|
|
|
|
|
|
|
|
CLASS: {
|
|
|
|
{ +superclass+ "NSObject" }
|
2009-09-07 23:48:57 -04:00
|
|
|
{ +name+ "Bar" }
|
2009-09-07 18:59:34 -04:00
|
|
|
} {
|
2009-09-07 23:48:57 -04:00
|
|
|
"bar:"
|
2009-10-21 19:17:29 -04:00
|
|
|
float
|
|
|
|
{ id SEL NSRect }
|
2009-09-07 18:59:34 -04:00
|
|
|
[
|
|
|
|
[ origin>> [ x>> ] [ y>> ] bi + ]
|
|
|
|
[ size>> [ w>> ] [ h>> ] bi + ]
|
|
|
|
bi +
|
|
|
|
]
|
|
|
|
} ;
|
|
|
|
|
|
|
|
: main ( -- )
|
2009-09-07 23:48:57 -04:00
|
|
|
Bar -> alloc -> init
|
|
|
|
S{ CGRect f S{ CGPoint f 1.0 2.0 } S{ CGSize f 3.0 4.0 } } -> bar:
|
2009-09-07 18:59:34 -04:00
|
|
|
10.0 assert= ;
|
|
|
|
|
|
|
|
MAIN: main
|