Mercurial > projects > doodle
annotate gui.d @ 12:a093c4fbdd43
Checkpoint
author | "David Bryant <bagnose@gmail.com>" |
---|---|
date | Sun, 12 Jul 2009 00:39:35 +0930 |
parents | fb571a3b1f0d |
children | 0b7e7d43a79d |
rev | line source |
---|---|
0 | 1 module gui; |
2 | |
11 | 3 import icanvas; |
0 | 4 import canvas; |
12 | 5 import tool_layer; |
7 | 6 import tool; |
7 import standard_tools; | |
11 | 8 import page_layer; |
0 | 9 |
10 import gtk.Main; | |
11 import gtk.MainWindow; | |
12 | |
13 import tk.geometry; | |
14 import tk.types; | |
15 import tk.events; | |
16 | |
1 | 17 import std.stdio; |
3
7d57cae10805
Renamed geometry2 to geometry
David Bryant <daveb@acres.com.au>
parents:
2
diff
changeset
|
18 import tk.geometry; |
1 | 19 |
0 | 20 void main(string[] args) { |
21 Main.init(args); | |
22 auto window = new MainWindow("Title"); | |
7 | 23 Tool[] tools; |
24 tools ~= new PanTool; | |
25 tools ~= new ZoomTool; | |
12 | 26 auto tool_layer = new ToolLayer(tools, "Tools"); |
11 | 27 Layer[] layers; |
12 | 28 layers ~= new PageLayer("Page"); |
29 layers ~= tool_layer; | |
30 auto canvas = new Canvas(layers, tool_layer, 120.0); | |
0 | 31 window.add(canvas); |
8 | 32 window.setDefaultSize(420, 340); |
0 | 33 window.showAll(); |
34 Main.run(); | |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
1
diff
changeset
|
35 |
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
1
diff
changeset
|
36 /* |
3
7d57cae10805
Renamed geometry2 to geometry
David Bryant <daveb@acres.com.au>
parents:
2
diff
changeset
|
37 Point p3 = Point.DEFAULT; |
1 | 38 |
3
7d57cae10805
Renamed geometry2 to geometry
David Bryant <daveb@acres.com.au>
parents:
2
diff
changeset
|
39 Point p1 = Point(3.0, 5.0); |
1 | 40 writefln("%s", p1); |
41 | |
3
7d57cae10805
Renamed geometry2 to geometry
David Bryant <daveb@acres.com.au>
parents:
2
diff
changeset
|
42 Point p2 = Point(1.0, 2.0); |
1 | 43 writefln("%s", p2); |
44 | |
45 writefln("%s", p1 - p2); | |
46 | |
3
7d57cae10805
Renamed geometry2 to geometry
David Bryant <daveb@acres.com.au>
parents:
2
diff
changeset
|
47 Rectangle r = Rectangle(p1, p2); |
1 | 48 writefln("%s", r); |
2
d6f44347373d
* Switched over to geometry done with structs instead of classes.
David Bryant <daveb@acres.com.au>
parents:
1
diff
changeset
|
49 */ |
0 | 50 } |