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