]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/deploy/test/14/14.factor
Switch to https urls
[factor.git] / basis / tools / deploy / test / 14 / 14.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See https://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: Bar < NSObject
10     METHOD: float bar: NSRect rect [
11         rect origin>> [ x>> ] [ y>> ] bi +
12         rect size>> [ w>> ] [ h>> ] bi +
13         +
14     ] ;
15 ;CLASS>
16
17 : main ( -- )
18     Bar -> alloc -> init
19     S{ CGRect f S{ CGPoint f 1.0 2.0 } S{ CGSize f 3.0 4.0 } } -> bar:
20     10.0 assert= ;
21
22 MAIN: main