From 50100c3ea532d9d5686528f82af278c81102f80c Mon Sep 17 00:00:00 2001 From: "Crom (Thibaut CHARLES)" Date: Thu, 20 Nov 2014 09:08:14 +0100 Subject: [PATCH] First try at removing columns --- source/app.d | 73 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 18 deletions(-) diff --git a/source/app.d b/source/app.d index 8e1dd9b..356a91c 100644 --- a/source/app.d +++ b/source/app.d @@ -202,14 +202,27 @@ void main(string[] args) buttonNewCol.addOnClicked((Button){ auto oldstore = cast(ListStore)tree.getModel(); int newColIndex = oldstore.getNColumns(); + + + foreach(i ; 0..tree.getNColumns){ + auto col = tree.getColumn(i); + writeln("col",i,"=",col, "(", col is null? "" : col.getTitle, ")"); + } GType[] types; string[] titles; - foreach(i ; 0..newColIndex){ + int[] storeIndex; + foreach(i ; 0..tree.getNColumns){ + writeln("Saving ",i); if(i==0)types~= GType.INT; else types~= GType.STRING; - titles~= tree.getColumn(0).getTitle; + + storeIndex~= GetColumnStoreIndex(tree, 0)>=0?GetColumnStoreIndex(tree, 0):0; + + auto col = tree.getColumn(0); + if(col !is null) titles~= tree.getColumn(0).getTitle; + else titles~= "ERR"; tree.removeColumn(tree.getColumn(0)); } types~=GType.STRING; @@ -227,9 +240,8 @@ void main(string[] args) foreach(i ; 0..newColIndex+1){ if(i