summaryrefslogtreecommitdiff
path: root/gui.go
diff options
context:
space:
mode:
Diffstat (limited to 'gui.go')
-rw-r--r--gui.go46
1 files changed, 7 insertions, 39 deletions
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(