futher choose better names
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
b28c2c09fa
commit
97d7ad349e
14
table.go
14
table.go
|
@ -15,13 +15,6 @@ type cellTest struct {
|
||||||
jwc [20]ui.TableValue
|
jwc [20]ui.TableValue
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
type cellValue struct {
|
|
||||||
ref int // libUI reference int
|
|
||||||
value ui.TableValue // cell Value (TableString, TableColor or TableImage)
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
type modelHandler struct {
|
type modelHandler struct {
|
||||||
name string
|
name string
|
||||||
rowcount int
|
rowcount int
|
||||||
|
@ -31,8 +24,7 @@ type modelHandler struct {
|
||||||
|
|
||||||
generatedColumnTypes []ui.TableValue // generate this dynamically
|
generatedColumnTypes []ui.TableValue // generate this dynamically
|
||||||
|
|
||||||
// This is a needed function for libUI tables (maybe)
|
libUIevent func(*modelHandler, *ui.TableModel, int, int, ui.TableValue)
|
||||||
setCellValue func(*modelHandler, *ui.TableModel, int, int, ui.TableValue)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func initValues(mh *modelHandler) {
|
func initValues(mh *modelHandler) {
|
||||||
|
@ -89,8 +81,8 @@ func newModelHandler(rowcount int) *modelHandler {
|
||||||
|
|
||||||
mh.rowcount = rowcount
|
mh.rowcount = rowcount
|
||||||
|
|
||||||
// These are the standard callback functions for libUI
|
// This is the standard callback function from libUI when the user does something
|
||||||
mh.setCellValue = defaultSetCellValue
|
mh.libUIevent = defaultSetCellValue
|
||||||
|
|
||||||
mh.rowBGcolor = 0 // this is the weird exception. Just always have this as 0
|
mh.rowBGcolor = 0 // this is the weird exception. Just always have this as 0
|
||||||
|
|
||||||
|
|
|
@ -31,11 +31,11 @@ func (mh *modelHandler) SetCellValue(m *ui.TableModel, row, column int, value ui
|
||||||
log.Println("SetCallValue() START row=", row, "column=", column, "value=", value)
|
log.Println("SetCallValue() START row=", row, "column=", column, "value=", value)
|
||||||
// spew.Dump(m)
|
// spew.Dump(m)
|
||||||
// spew.Dump(mh)
|
// spew.Dump(mh)
|
||||||
if (mh.setCellValue == nil) {
|
if (mh.libUIevent == nil) {
|
||||||
log.Println("CellValue NOT DEFINED. This table wasn't setup correctly! mh.scanCellValue == nil")
|
log.Println("CellValue NOT DEFINED. This table wasn't setup correctly! mh.scanCellValue == nil")
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
// spew.Dump(m)
|
// spew.Dump(m)
|
||||||
mh.setCellValue(mh, m, row, column, value)
|
mh.libUIevent(mh, m, row, column, value)
|
||||||
log.Println("SetCallValue() END")
|
log.Println("SetCallValue() END")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue