-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraphdisplay.pl
More file actions
57 lines (47 loc) · 1.59 KB
/
graphdisplay.pl
File metadata and controls
57 lines (47 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
graph_display(Ref) :-
new(Ref, picture('Tangible Interface')),
get(@display, width, W),
get(@display, height, H),
send(Ref, size, size(W, H)),
send(Ref, move, point(0,0)),
send(Ref, open).
add_stuff_demo(Ref) :-
send(Ref, display, text('I have no ref'), point(200,200)),
send(Ref, display, ellipse(50,50), point(40,40)), % no ref here either
new(E, ellipse(60,60)),
send(Ref, display, E, point(100,40)),
free(E), % it will never show up
new(F, ellipse(80,40)),
send(Ref, display, F),
send(F, shadow, 13),
% send(F, selected, true),
send(F, pen, 5),
send(F, colour, blue),
send(F, fill_pattern, colour(green)),
get(F, area, A),
debug(graph_display(demo), 'area of F is ~w', [A]),
send(F, center, point(35, 190)),
new(C, device),
send(Ref, display, C),
new(DE, ellipse(50,50)),
new(DE2, ellipse(50,50)),
send(C, display, DE),
send(C, display, DE2),
send(C, center, point(300,300)),
send(DE2, colour, yellow),
gensym(taco, Name),
new(@Name, ellipse(160,200)), % we can indirect names
send(Ref, display, @Name),
new(Path, path(smooth, 5)),
send(Path, center, point(200,300)),
send(Path, closed, true),
send(Path, append, point(100,100)),
send(Path, append, point(280,120)),
send(Path, append, point(240,200)),
send(Path, append, point(130,260)),
send(Path, append, point(100,100)),
send(Path, append, point(118,102)),
send(Path, pen, 5),
send(Path, colour, colour(green)),
send(Path, fill_pattern, colour(red)),
send(Ref, display, Path).