comparison doodle/main/prog/doodler.d @ 54:30ecedfe2ce2

Partial palette support
author "David Bryant <bagnose@gmail.com>"
date Sun, 08 Aug 2010 21:07:47 +0930
parents 0eaf39fda206
children 4922e746dd76
comparison
equal deleted inserted replaced
53:fbabd1957c89 54:30ecedfe2ce2
18 18
19 import std.stdio; 19 import std.stdio;
20 } 20 }
21 21
22 void main(string[] args) { 22 void main(string[] args) {
23 void paletteCallback(int index) {
24 writefln("Callback %s", index);
25 }
26
23 Main.init(args); 27 Main.init(args);
24 auto window = new MainWindow("Doodle"); 28 auto window = new MainWindow("Doodle");
25 auto vbox = new VBox(false, 0); 29 auto vbox = new VBox(false, 0);
26 /+ 30 /+
27 auto toolBar = new ToolBar; 31 auto toolBar = new ToolBar;
28 vbox.packStart(toolBar, false, false, 0); 32 vbox.packStart(toolBar, false, false, 0);
29 +/ 33 +/
30 34
31 auto palette = new Palette; 35 auto palette = new Palette;
36 IPalette.Item[] items =
37 [
38 { "select.svg", "Select", &paletteCallback },
39 { "select.svg", "Select", &paletteCallback }
40 ];
41 palette.configure(items);
42 /*
32 palette.add("select.svg", "tooltip-text", (int i){ writefln("Wow %s", i); }); 43 palette.add("select.svg", "tooltip-text", (int i){ writefln("Wow %s", i); });
33 palette.add("select.svg", "tooltip-text", (int i){ writefln("Wow %s", i); }); 44 palette.add("select.svg", "tooltip-text", (int i){ writefln("Wow %s", i); });
34 palette.add("select.svg", "tooltip-text", (int i){ writefln("Wow %s", i); }); 45 palette.add("select.svg", "tooltip-text", (int i){ writefln("Wow %s", i); });
35 palette.add("select.svg", "tooltip-text", (int i){ writefln("Wow %s", i); }); 46 palette.add("select.svg", "tooltip-text", (int i){ writefln("Wow %s", i); });
36 palette.add("select.svg", "tooltip-text", (int i){ writefln("Wow %s", i); }); 47 palette.add("select.svg", "tooltip-text", (int i){ writefln("Wow %s", i); });
48 */
37 vbox.packStart(palette, false, false, 0); 49 vbox.packStart(palette, false, false, 0);
38 50
39 Tool[] tools; 51 Tool[] tools;
40 tools ~= new PanTool; 52 tools ~= new PanTool;
41 tools ~= new ZoomTool; 53 tools ~= new ZoomTool;