From 800f8db555c723092c84c852d91b100d0d1bf34e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 12 May 2019 15:11:32 -0700 Subject: export all the structs in TableData Signed-off-by: Jeff Carr --- tableCallbacks.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tableCallbacks.go') diff --git a/tableCallbacks.go b/tableCallbacks.go index 8e9eda3..9f8f707 100644 --- a/tableCallbacks.go +++ b/tableCallbacks.go @@ -12,22 +12,22 @@ import "log" import "github.com/andlabs/ui" import _ "github.com/andlabs/ui/winmanifest" -func (mh *tableData) NumRows(m *ui.TableModel) int { - return mh.rowcount +func (mh *TableData) NumRows(m *ui.TableModel) int { + return mh.RowCount } // FYI: this routine seems to be called around 10 to 100 times a second for each table -func (mh *tableData) ColumnTypes(m *ui.TableModel) []ui.TableValue { +func (mh *TableData) ColumnTypes(m *ui.TableModel) []ui.TableValue { return mh.generatedColumnTypes } // TODO: Figure out why this is being called 1000 times a second (10 times for each row & column) // Nevermind this TODO. Who gives a shit. This is a really smart way to treat the OS toolkits -func (mh *tableData) CellValue(m *ui.TableModel, row, column int) ui.TableValue { - return mh.rows[row].cells[column].value +func (mh *TableData) CellValue(m *ui.TableModel, row, column int) ui.TableValue { + return mh.Rows[row].Cells[column].Value } -func (mh *tableData) SetCellValue(m *ui.TableModel, row, column int, value 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) @@ -37,5 +37,8 @@ func (mh *tableData) SetCellValue(m *ui.TableModel, row, column int, value ui.Ta } // spew.Dump(m) mh.libUIevent(mh, m, row, column, value) + if (mh.cellChangeEvent != nil) { + mh.cellChangeEvent(row, column, value) + } log.Println("SetCallValue() END") } -- cgit v1.2.3