summaryrefslogtreecommitdiff
path: root/gui.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-08 20:08:51 -0700
committerJeff Carr <[email protected]>2019-05-08 20:08:51 -0700
commitf6af028f63554aa0bab17986780fb2d5589eed3c (patch)
tree7e5eed532eff72775fb63d529ed49359cd16f0ab /gui.go
parent366224aaecee90ad8502bf1c85e804f05d500163 (diff)
almost completely automated row and column layout now
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gui.go')
-rw-r--r--gui.go28
1 files changed, 25 insertions, 3 deletions
diff --git a/gui.go b/gui.go
index 61ccc07..cb84f73 100644
--- a/gui.go
+++ b/gui.go
@@ -270,7 +270,8 @@ func initColumnNames(mh *tableData, cellJWC string, junk string) {
}
}
-func initRow(mh *tableData, row int) {
+func initRow(mh *tableData, row int, parts []InputData) {
+/*
initRowBTcolor (mh, row, 0)
initRowTextColorColumn(mh, row, 1, 2, "diff1", ui.TableColor{0.0, 0, 0.9, 1})
initRowButtonColumn (mh, row, 3, "diff2")
@@ -278,6 +279,27 @@ func initRow(mh *tableData, row int) {
initRowTextColorColumn(mh, row, 6, 7, "diff4", ui.TableColor{0.9, 0.3, 0.1, 1})
initRowTextColumn (mh, row, 8, "diff5")
initRowButtonColumn (mh, row, 9, "diff6")
+*/
+
+ tmpBTindex := 0
+ for key, foo := range parts {
+ log.Println(key, foo)
+ if (foo.CellType == "BG") {
+ initRowBTcolor (mh, row, tmpBTindex)
+ tmpBTindex += 1
+ } else if (foo.CellType == "BUTTON") {
+ initRowButtonColumn (mh, row, tmpBTindex, "diff2")
+ tmpBTindex += 1
+ } else if (foo.CellType == "TEXTCOLOR") {
+ initRowTextColorColumn(mh, row, tmpBTindex, tmpBTindex + 1, "diff1", ui.TableColor{0.0, 0, 0.9, 1})
+ tmpBTindex += 2
+ } else if (foo.CellType == "TEXT") {
+ initRowTextColumn (mh, row, tmpBTindex, "diff5")
+ tmpBTindex += 1
+ } else {
+ panic("I don't know what this is in initColumnNames")
+ }
+ }
}
type InputData struct {
@@ -312,10 +334,10 @@ func AddTableTab(name string, rowcount int, parts []InputData) {
mh.rows = append(mh.rows, b...)
for row := 0; row < mh.rowcount; row++ {
- initRow(mh, row)
+ initRow(mh, row, parts)
}
- initRow(mh, mh.rowcount)
+ initRow(mh, mh.rowcount, parts)
mh.rowcount = rowcount + 1
log.Println(mh)