some data is flowing all the way through to the GUI for the first time

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-12 21:01:22 -07:00
parent c58f4d0c61
commit dd753552fd
3 changed files with 26 additions and 5 deletions

5
gui.go
View File

@ -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

View File

@ -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) {

View File

@ -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")
}