class

UIng::Table

Inherits UIng::Control < UIng::BlockConstructor < Reference < Object

Table::Model manages data for Table controls.

CRITICAL MEMORY MANAGEMENT WARNINGS:

  1. Table::Model MUST be freed AFTER all Tables using it are destroyed
  2. Table::Model::Handler callbacks become invalid after Table::Model is freed
  3. DO NOT rely on GC/finalize for automatic cleanup - use explicit free()
  4. Avoid circular references in Table::Model::Handler callbacks

Safe usage pattern: model_handler = Table::Model::Handler.new model = Table::Model.new(model_handler) table = Table.new(model)

... use table ...

table.destroy # Destroy table first model.free # Then free model

Constructors

new(*args, &)
Source
new(*args, **kwargs, &)
Source
new(model : Model, row_background_color_model_column : LibC::Int = -1)

IMPORTANT: This method accepts Table::Model instead of Table::Params

Source

Instance methods

append_button_column(name : String, button_model_column : Int32, clickable : Int32 | ModelColumn) : Nil

clickable follows the same rules as column editability.

Source
append_checkbox_column(name : String, checkbox_model_column : Int32, editable : Int32 | ModelColumn) : Nil
Source
append_checkbox_text_column(name : String, checkbox_model_column : Int32, checkbox_editable : Int32 | ModelColumn, text_model_column : Int32, text_editable : Int32 | ModelColumn, table_text_column_optional_params : TextColumnOptionalParams) : Nil
Source
append_checkbox_text_column(name : String, checkbox_model_column : Int32, checkbox_editable : Int32 | ModelColumn, text_model_column : Int32, text_editable : Int32 | ModelColumn, color_model_column : Int32) : Nil
Source
append_checkbox_text_column(name : String, checkbox_model_column : Int32, checkbox_editable : Int32 | ModelColumn, text_model_column : Int32, text_editable : Int32 | ModelColumn) : Nil
Source
append_image_column(name : String, image_model_column : Int32) : Nil
Source
append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, editable : Int32 | ModelColumn, table_text_column_optional_params : TextColumnOptionalParams) : Nil
Source
append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, editable : Int32 | ModelColumn, color_model_column : Int32) : Nil
Source
append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, editable : Int32 | ModelColumn) : Nil
Source
append_progress_bar_column(name : String, progress_model_column : Int32) : Nil
Source
append_text_column(name : String, text_model_column : Int32, editable : Int32 | ModelColumn, table_text_column_optional_params : TextColumnOptionalParams) : Nil
Source
append_text_column(name : String, text_model_column : Int32, editable : Int32 | ModelColumn, color_model_column : Int32) : Nil
Source
append_text_column(name : String, text_model_column : Int32, editable : Int32 | ModelColumn) : Nil

editable can be :never, :always, or a model column whose values control editability for each row.

Source
clear_on_header_clicked

Clears the callback; equivalent to on_header_clicked(nil).

Source
clear_on_row_clicked

Clears the callback; equivalent to on_row_clicked(nil).

Source
clear_on_row_double_clicked

Clears the callback; equivalent to on_row_double_clicked(nil).

Source
clear_on_selection_changed

Clears the callback; equivalent to on_selection_changed(nil).

Source
column_set_width(column : Int32, width : Int32) : Nil
Source
column_width(column : Int32) : Int32
Source
each_selected_index

Yields each selected row index without copying the native row array into a Crystal Array. The native selection snapshot is freed after iteration, including when the block raises. Use selection to retain a snapshot.

Source
header_set_sort_indicator(column : Int32, sort_indicator : SortIndicator) : Nil
Source
header_sort_indicator(column : Int32) : SortIndicator
Source
header_visible=(value : Bool)
Source
header_visible?
Source
on_header_clicked
Source
on_header_clicked(callback : Nil) : Nil
Source
on_row_clicked
Source
on_row_clicked(callback : Nil) : Nil
Source
on_row_double_clicked
Source
on_row_double_clicked(callback : Nil) : Nil
Source
on_selection_changed
Source
on_selection_changed(callback : Nil) : Nil
Source
selection
Source
selection=(selection : Selection) : Nil
Source
selection_mode
Source
selection_mode=(mode : Selection::Mode) : Nil
Source
to_unsafe
Source

Nested types