]> gitweb.factorcode.org Git - factor.git/blob - core/ui/test/gadgets.factor
af0ba87574f434e6e537bf6e53a245b3def07c30
[factor.git] / core / ui / test / gadgets.factor
1 IN: temporary
2 USING: gadgets test namespaces ;
3
4 TUPLE: fooey ;
5
6 [ ] [ <gadget> <fooey> set-gadget-delegate ] unit-test
7 [ ] [ f <fooey> set-gadget-delegate ] unit-test
8
9 [ { 300 300 } ]
10 [
11     ! c contains b contains a
12     <gadget> "a" set
13     <gadget> "b" set
14     "a" get "b" get add-gadget
15     <gadget> "c" set
16     "b" get "c" get add-gadget
17     
18     ! position a and b
19     { 100 200 } "a" get set-rect-loc
20     { 200 100 } "b" get set-rect-loc
21     
22     ! give c a loc, it doesn't matter
23     { -1000 23 } "c" get set-rect-loc
24
25     ! what is the location of a inside c?
26     "a" get "c" get relative-loc
27 ] unit-test