]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/deploy/test/14/14.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / basis / tools / deploy / test / 14 / 14.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors classes.struct cocoa cocoa.classes
4 cocoa.runtime cocoa.subclassing cocoa.types core-graphics.types
5 kernel math ;
6 FROM: alien.c-types => float ;
7 IN: tools.deploy.test.14
8
9 CLASS: {
10     { +superclass+ "NSObject" }
11     { +name+ "Bar" }
12 } {
13     "bar:"
14     float
15     { id SEL NSRect }
16     [
17         [ origin>> [ x>> ] [ y>> ] bi + ]
18         [ size>> [ w>> ] [ h>> ] bi + ]
19         bi +
20     ]
21 } ;
22
23 : main ( -- )
24     Bar -> alloc -> init
25     S{ CGRect f S{ CGPoint f 1.0 2.0 } S{ CGSize f 3.0 4.0 } } -> bar:
26     10.0 assert= ;
27
28 MAIN: main