diff options
| author | Jeff Carr <[email protected]> | 2019-05-12 21:01:22 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-05-12 21:01:22 -0700 |
| commit | dd753552fdd28cc1feff911e51976a6946c502d1 (patch) | |
| tree | e411b9243edec2a572a13a6dab5c2b3e3d9a5e06 | |
| parent | c58f4d0c61b9e5731a69ff2ce75111c37dd818ae (diff) | |
some data is flowing all the way through to the GUI for the first time
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | gui.go | 5 | ||||
| -rw-r--r-- | table.go | 4 | ||||
| -rw-r--r-- | tableCallbacks.go | 22 |
3 files changed, 26 insertions, 5 deletions
@@ -91,8 +91,13 @@ func initColumnNames(mh *TableData, cellJWC string, junk string) { func initRow(mh *TableData, row int, 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, row, tmpBTindex, parts[key]) tmpBTindex += 1 @@ -68,6 +68,8 @@ func initRowBTcolor(mh *TableData, row int, intBG int, cell InputData) { mh.Rows[row].Cells[intBG].Name = "BG" mh.Rows[row].Cells[intBG].HumanID = humanInt + log.Println("HumanID = row, intBG, humanInt", row, intBG, humanInt) + // alternate background of each row light and dark if (row % 2) == 1 { mh.Rows[row].Cells[intBG].Value = ui.TableColor{0.5, 0.5, 0.5, .7} @@ -87,6 +89,8 @@ func initRowButtonColumn(mh *TableData, row int, buttonID int, junk string, cell mh.Rows[row].Cells[buttonID].Value = ui.TableString(fmt.Sprintf("%s %d", junk, row)) mh.Rows[row].Cells[buttonID].Name = "BUTTON" mh.Rows[row].Cells[buttonID].HumanID = humanInt + + log.Println("HumanID = row, buttonID, humanInt", row, buttonID, humanInt) } func initRowTextColorColumn(mh *TableData, row int, stringID int, colorID int, junk string, color ui.TableColor, cell InputData) { diff --git a/tableCallbacks.go b/tableCallbacks.go index 9f8f707..7c05d0e 100644 --- a/tableCallbacks.go +++ b/tableCallbacks.go @@ -28,17 +28,29 @@ func (mh *TableData) CellValue(m *ui.TableModel, row, column int) ui.TableValue } func (mh *TableData) SetCellValue(m *ui.TableModel, row, column int, value ui.TableValue) { - log.Println("SetCallValue() START row=", row, "column=", column, "value=", value) - // spew.Dump(m) - // spew.Dump(mh) + log.Println("SetCellValue() START row=", row, "column=", column, "value=", value) + if (mh.libUIevent == nil) { log.Println("CellValue NOT DEFINED. This table wasn't setup correctly! mh.scanCellValue == nil") os.Exit(-1) } - // spew.Dump(m) + mh.libUIevent(mh, m, row, column, value) if (mh.cellChangeEvent != nil) { mh.cellChangeEvent(row, column, value) } - log.Println("SetCallValue() END") + + log.Println("mh.Rows[0].Cells[column].HumanID =", mh.Rows[0].Cells[column].HumanID) + log.Println("mh.Rows[row].Cells[column].HumanID =", mh.Rows[row].Cells[column].HumanID) + + humanID := mh.Rows[row].Cells[column].HumanID + log.Println("mh.Rows[row].Human[humanID].ColorID =", mh.Rows[row].Human[humanID].ColorID) + log.Println("mh.Rows[row].Human[humanID].TextID =", mh.Rows[row].Human[humanID].TextID) + + if (column == mh.Rows[row].Human[humanID].TextID) { + log.Println("THIS COLUMN IS A TEXT COLUMN") + mh.Rows[row].Cells[column].Value = mh.Rows[row].Human[humanID].Text + } + + log.Println("SetCellValue() END") } |
