class

UIng::Table

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

Table::Selection represents selected rows in a Table.

AUTOMATIC MEMORY MANAGEMENT: Table::Selection is automatically managed by the UIng library. Users do NOT need to manually free Table::Selection objects.

Recommended usage patterns:

  1. Using on_selection_changed callback (RECOMMENDED): table.on_selection_changed do |selection| if selection.num_rows > 0 selected_row = selection.rows.first

    ... use selection data ...

    end

    Table::Selection is automatically freed after this block

end

  1. Manual selection access (use with caution): selection = table.selection # Get selection rows = selection.num_rows # Extract data immediately

... use selection data ...

selection.free # MUST free manually when using this pattern

  1. Setting a custom Table::Selection object via table.selection =: You can create a Table::Selection manually using Table::Selection.new(...) and assign it to a table. The data will be immediately copied or consumed by libui-ng, so the object does not need to be freed manually. Memory is automatically managed by Crystal's garbage collector.

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, button_clickable_model_column : Int32) : Nil
Source
append_checkbox_column(name : String, checkbox_model_column : Int32, checkbox_editable_model_column : Int32) : Nil
Source
append_checkbox_text_column(name : String, checkbox_model_column : Int32, checkbox_editable_model_column : Int32, text_model_column : Int32, text_editable_model_column : Int32, table_text_column_optional_params : TextColumnOptionalParams) : Nil
Source
append_checkbox_text_column(name : String, checkbox_model_column : Int32, checkbox_editable_model_column : Int32, text_model_column : Int32, text_editable_model_column : Int32, color_model_column : Int32) : Nil
Source
append_checkbox_text_column(name : String, checkbox_model_column : Int32, checkbox_editable_model_column : Int32, text_model_column : Int32, text_editable_model_column : Int32) : 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, text_editable_model_column : Int32, table_text_column_optional_params : TextColumnOptionalParams) : Nil
Source
append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, text_editable_model_column : Int32, color_model_column : Int32) : Nil
Source
append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, text_editable_model_column : Int32) : Nil
Source
append_progress_bar_column(name : String, progress_model_column : Int32) : Nil
Source
append_text_column(name : String, text_model_column : Int32, text_editable_model_column : Int32, table_text_column_optional_params : TextColumnOptionalParams) : Nil
Source
append_text_column(name : String, text_model_column : Int32, text_editable_model_column : Int32, color_model_column : Int32) : Nil
Source
append_text_column(name : String, text_model_column : Int32, text_editable_model_column : Int32) : Nil
Source
column_set_width(column : Int32, width : Int32) : Nil
Source
column_width(column : Int32) : Int32
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_row_clicked
Source
on_row_double_clicked
Source
on_selection_changed
Source
selection
Source
selection

Block version that automatically frees the selection after the block This eliminates the need for manual free() calls

Source
selection=(selection : Selection) : Nil
Source
selection_mode
Source
selection_mode=(mode : Selection::Mode) : Nil
Source
to_unsafe
Source

Nested types