TableView
classin packageklyn.gui.windows
public class TableView extends Widget:
└ TableView

Spreadsheet-like table widget backed by a TableModel.

model = TableModel("users").addColumn("id").addColumn("login")
model.addRow(["1", "admin"])
table = TableView(model)
table.cellSelected += lambda(event: TableCellEvent): print(table.selectedValue)
Fields
Modifier and Type Member Description
public event cellSelected
cellSelected as TableCellEvent
Emitted when the current cell changes by mouse or keyboard.
Attributes inherited from Widget: keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Properties
Modifier and Type Member Description
public property model
model as TableModel:
Data model rendered by the view.
public property selectedColumn
selectedColumn as Int = -1
No summary.
public property selectedRow
selectedRow as Int = -1
No summary.
public readonly property selectedValue
selectedValue as String:
Text value of the selected cell, or an empty string when none is selected.
Properties inherited from Widget: accentColor, backgroundColor, borderColor, bottom, canFocus, cornerRadius, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, right, sizePolicy, styleClass, width, window, x, y
Constructors
Modifier and Type Member Description
public TableView
TableView(model as TableModel = null):
Creates a table view with an optional model.
Methods
Modifier and Type Member Description
public override paint
paint(painter as Painter) as Void:
No summary.
public setSelectedValue
setSelectedValue(value as String) as Boolean:
Updates the selected cell when the model is editable.
Methods inherited from Widget: blur, containsPoint, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintOverlay, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds