diff --git a/table.go b/table.go index c602883..49f8373 100644 --- a/table.go +++ b/table.go @@ -20,6 +20,7 @@ type vmRowData struct { var img [2]*ui.Image +// TODO: make this better type jwcTest struct { part0 ui.TableColor // row background color part1 ui.TableString // column 0 text @@ -36,14 +37,10 @@ type modelHandler struct { name string rows int bgcolorColumn int - yellowRow int - checkStates []int - vms []vmRowData - bgcolor []ui.TableColor cellValues []jwcTest - columnTypes string + // These are the needed functions for libUI tables funcColumnTypes func() []ui.TableValue scanCellValue func(*modelHandler, int, int) ui.TableValue setCellValue func(*modelHandler, *ui.TableModel, int, int, ui.TableValue) @@ -55,7 +52,6 @@ func initValues(mh *modelHandler) { for i := 0; i < mh.rows; i++ { log.Println("i=",i) - mh.vms[i].hostname = fmt.Sprintf("jcarrnew %d", i) // alternate background of each row light and dark if (i % 2) == 1 { @@ -98,22 +94,13 @@ func newModelHandler(rows int) *modelHandler { mh := new(modelHandler) mh.rows = rows - mh.columnTypes = "standard" mh.funcColumnTypes = standardColumnTypes mh.scanCellValue = defaultCellValue mh.setCellValue = defaultSetCellValue mh.bgcolorColumn = 0 - mh.checkStates = make([]int, mh.rows) - - mh.vms = make([]vmRowData, mh.rows) - mh.bgcolor = make([]ui.TableColor, mh.rows) - mh.cellValues = make([]jwcTest, mh.rows) - mh.vms[1].hostname = "jcarr" - mh.yellowRow = -1 - initValues(mh) log.Println("Called newModelhandler() with mh=", mh)