factor/basis/tools/deploy/test/14/14.factor

27 lines
584 B
Factor
Raw Normal View History

! 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 23:48:57 -04:00
"bar:"
float
{ id SEL NSRect }
[
[ 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:
10.0 assert= ;
MAIN: main