From 5ec1416d20f874fe0ef01b9f33ba86dbe5960435 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 13 May 2019 00:30:38 -0700 Subject: combined table column init Signed-off-by: Jeff Carr --- gui.go | 46 +++++++--------------------------------------- 1 file changed, 7 insertions(+), 39 deletions(-) (limited to 'gui.go') diff --git a/gui.go b/gui.go index 21757a0..c9ea6f7 100644 --- a/gui.go +++ b/gui.go @@ -58,33 +58,6 @@ func initColumnNames(mh *TableData, cellJWC string, junk string) { } } -func initRow(mh *TableData, parts []InputData) { - tmpBTindex := 0 - humanID := 0 - for key, foo := range parts { - log.Println(key, foo) - - parts[key].Index = humanID - humanID += 1 - - if (foo.CellType == "BG") { - initRowBTcolor (mh, tmpBTindex, parts[key]) - tmpBTindex += 1 - } else if (foo.CellType == "BUTTON") { - initRowButtonColumn (mh, tmpBTindex, parts[key].Heading, parts[key]) - tmpBTindex += 1 - } else if (foo.CellType == "TEXTCOLOR") { - initRowTextColorColumn(mh, tmpBTindex, tmpBTindex + 1, parts[key].Heading, ui.TableColor{0.0, 0, 0.9, 1}, parts[key]) - tmpBTindex += 2 - } else if (foo.CellType == "TEXT") { - initRowTextColumn (mh, tmpBTindex, parts[key].Heading, parts[key]) - tmpBTindex += 1 - } else { - panic("I don't know what this is in initColumnNames") - } - } -} - func AddTableTab(mytab *ui.Tab, mytabcount int, name string, rowcount int, parts []InputData) *TableData { mh := new(TableData) @@ -92,18 +65,13 @@ func AddTableTab(mytab *ui.Tab, mytabcount int, name string, rowcount int, parts mh.Rows = make([]RowData, mh.RowCount) tmpBTindex := 0 - + humanID := 0 for key, foo := range parts { - log.Println(key, foo) - initColumnNames(mh, foo.CellType, foo.Heading) - } + log.Println("key, foo =", key, foo) + // log.Println("mh.Cells =", mh.Cells) + // log.Println("mh.Human =", mh.Human) -/* - tmpBTindex = 0 - humanID = 0 - - for key, foo := range parts { - log.Println(key, foo) + initColumnNames(mh, foo.CellType, foo.Heading) parts[key].Index = humanID humanID += 1 @@ -124,8 +92,8 @@ func AddTableTab(mytab *ui.Tab, mytabcount int, name string, rowcount int, parts panic("I don't know what this is in initColumnNames") } } -*/ - initRow(mh, parts) + tmpBTindex = 0 + humanID = 0 model := ui.NewTableModel(mh) table := ui.NewTable( -- cgit v1.2.3