Mercurial > projects > doodle
view doodle/gtk/toolbar.d @ 28:1754cb773d41
Part-way through getting to compile with configure/builder.
author | Graham St Jack <graham.stjack@internode.on.net> |
---|---|
date | Sun, 02 Aug 2009 16:27:21 +0930 |
parents | gtk/tool_bar.d@f3d91579bb28 |
children | 960b408d3ac5 |
line wrap: on
line source
module gtk.toolbar; public { import gtk.Toolbar; } private { import gtk.ToolButton; import gtk.SeparatorToolItem; import gtk.RadioToolButton; import gtk.Image; import glib.ListSG; import std.stdio; } class ToolBar : Toolbar { this() { // INVALID, MENU, SMALL_TOOLBAR, LARGE_TOOLBAR, // BUTTON, DND, DIALOG setIconSize(GtkIconSize.LARGE_TOOLBAR); // ICONS, TEXT, BOTH, BOTH_HORIZ setStyle(GtkToolbarStyle.ICONS); // HORIZONTAL, VERTICAL setOrientation(GtkOrientation.HORIZONTAL); setTooltips(true); Image image; ListSG group; image = new Image("icons/select.svg"); button1 = new RadioToolButton(group); button1.setLabelWidget(image); insert(button1); image = new Image("icons/select.png"); button2 = new RadioToolButton(group); button2.setGroup(button1.getGroup); button2.setLabelWidget(image); button2.addOnClicked(&on_clicked); insert(button2); insert(new SeparatorToolItem); image = new Image("icons/select.png"); button3 = new RadioToolButton(group); button3.setGroup(button1.getGroup); button3.setLabelWidget(image); insert(button3); } private { void on_clicked(ToolButton tool_button) { writefln("Clicked!"); } RadioToolButton button1; RadioToolButton button2; RadioToolButton button3; } }