Fixes for Windows

This commit is contained in:
Crom (Thibaut CHARLES) 2014-11-17 23:25:13 +01:00
parent b384a661d4
commit 64f7b92679

View File

@ -13,7 +13,8 @@ import gtk.Label;
import gtk.Entry; import gtk.Entry;
import gtk.CellRenderer; import gtk.CellRenderer;
import gtk.CellRendererText; import gtk.CellRendererText;
import gtk.HeaderBar; import gtk.VBox;
import gtk.Button; import gtk.Button;
void[] Serialize(VT...)(VT data){ void[] Serialize(VT...)(VT data){
@ -34,14 +35,31 @@ void main(string[] args)
//Window //Window
auto window = new MainWindow("2DA-Edit"); auto window = new MainWindow("2DA-Edit");
auto cont = new VBox(false, 0);
window.add(cont);
Button saveButton = new Button(StockID.SAVE);
version(Windows){
//Menu bar
import gtk.HBox;
auto cont2 = new HBox(false, 0);
cont.packStart(cont2, false, false, 0);
cont2.packEnd(saveButton, false, false, 0);
}
else{
//Header bar //Header bar
import gtk.HeaderBar;
auto header = new HeaderBar(); auto header = new HeaderBar();
window.setTitlebar(header); window.setTitlebar(header);
header.setTitle("2DAEdit"); header.setTitle("2DAEdit");
header.setSubtitle(args[1]); header.setSubtitle(args[1]);
header.setProperty("show-close-button", true); header.setProperty("show-close-button", true);
auto saveButton = new Button(StockID.SAVE); saveButton = new Button(StockID.SAVE);
header.packEnd(saveButton); header.packEnd(saveButton);
}
//Database for 2da GTK table //Database for 2da GTK table
GType type[]; GType type[];
@ -52,7 +70,7 @@ void main(string[] args)
//TreeView to display database //TreeView to display database
auto tree = new TreeView(store); auto tree = new TreeView(store);
window.add(tree); cont.packEnd(tree, true, true, 0);
tree.setHeadersVisible(true); tree.setHeadersVisible(true);
tree.setEnableSearch(true); tree.setEnableSearch(true);