diff options
| author | Jeff Carr <[email protected]> | 2019-05-13 00:30:38 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-05-13 00:30:38 -0700 |
| commit | 5ec1416d20f874fe0ef01b9f33ba86dbe5960435 (patch) | |
| tree | d13316484d9a525b6b75f96180e3b1ae4c4c91d1 /gui.go | |
| parent | f3eeb4e9ec6160552f3213eea2d6f2442bc90e89 (diff) | |
combined table column init
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gui.go')
| -rw-r--r-- | gui.go | 46 |
1 files changed, 7 insertions, 39 deletions
@@ -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( |
