TableModelHandler defines the methods that TableModel calls when it needs data.
| 104 | // TableModelHandler defines the methods that TableModel |
| 105 | // calls when it needs data. |
| 106 | type TableModelHandler interface { |
| 107 | // ColumnTypes returns a slice of value types of the data |
| 108 | // stored in the model columns of the TableModel. |
| 109 | // Each entry in the slice should ideally be a zero value for |
| 110 | // the TableValue type of the column in question; the number |
| 111 | // of elements in the slice determines the number of model |
| 112 | // columns in the TableModel. The returned slice must remain |
| 113 | // constant through the lifetime of the TableModel. This |
| 114 | // method is not guaranteed to be called depending on the |
| 115 | // system. |
| 116 | ColumnTypes(m *TableModel) []TableValue |
| 117 | |
| 118 | // NumRows returns the number or rows in the TableModel. |
| 119 | // This value must be non-negative. |
| 120 | NumRows(m *TableModel) int |
| 121 | |
| 122 | // CellValue returns a TableValue corresponding to the model |
| 123 | // cell at (row, column). The type of the returned TableValue |
| 124 | // must match column's value type. Under some circumstances, |
| 125 | // nil may be returned; refer to the various methods that add |
| 126 | // columns to Table for details. |
| 127 | CellValue(m *TableModel, row, column int) TableValue |
| 128 | |
| 129 | // SetCellValue changes the model cell value at (row, column) |
| 130 | // in the TableModel. Within this function, either do nothing |
| 131 | // to keep the current cell value or save the new cell value as |
| 132 | // appropriate. After SetCellValue is called, the Table will |
| 133 | // itself reload the table cell. Under certain conditions, the |
| 134 | // TableValue passed in can be nil; refer to the various |
| 135 | // methods that add columns to Table for details. |
| 136 | SetCellValue(m *TableModel, row, column int, value TableValue) |
| 137 | } |
| 138 | |
| 139 | //export pkguiDoTableModelNumColumns |
| 140 | func pkguiDoTableModelNumColumns(umh *C.uiTableModelHandler, um *C.uiTableModel) C.int { |
no outgoing calls
no test coverage detected