class
UIng::Table
- UIng::Table
- UIng::Control
- Reference
- Object
Overview
Table::Model manages data for Table controls.
CRITICAL MEMORY MANAGEMENT WARNINGS:
- Table::Model MUST be freed AFTER all Tables using it are destroyed
- Table::Model::Handler callbacks become invalid after Table::Model is freed
- DO NOT rely on GC/finalize for automatic cleanup - use explicit free()
- 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
Defined in:
uing/crimage.cruing/table/table.cr
uing/table/table/model.cr
uing/table/table/model/handler.cr
uing/table/table/model_column.cr
uing/table/table/params.cr
uing/table/table/selection.cr
uing/table/table/selection/mode.cr
uing/table/table/sort_indicator.cr
uing/table/table/text_column_optional_params.cr
uing/table/table/value.cr
uing/table/table/value/type.cr
Constructors
- .new(*args, &)
- .new(*args, **kwargs, &)
-
.new(model : Model, row_background_color_model_column : LibC::Int = -1)
IMPORTANT: This method accepts Table::Model instead of Table::Params
Instance Method Summary
-
#append_button_column(name : String, button_model_column : Int32, clickable : Int32 | ModelColumn) : Nil
clickablefollows the same rules as column editability. - #append_checkbox_column(name : String, checkbox_model_column : Int32, editable : Int32 | ModelColumn) : Nil
- #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
- #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
- #append_checkbox_text_column(name : String, checkbox_model_column : Int32, checkbox_editable : Int32 | ModelColumn, text_model_column : Int32, text_editable : Int32 | ModelColumn) : Nil
- #append_image_column(name : String, image_model_column : Int32) : Nil
- #append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, editable : Int32 | ModelColumn, table_text_column_optional_params : TextColumnOptionalParams) : Nil
- #append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, editable : Int32 | ModelColumn, color_model_column : Int32) : Nil
- #append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, editable : Int32 | ModelColumn) : Nil
- #append_progress_bar_column(name : String, progress_model_column : Int32) : Nil
- #append_text_column(name : String, text_model_column : Int32, editable : Int32 | ModelColumn, table_text_column_optional_params : TextColumnOptionalParams) : Nil
- #append_text_column(name : String, text_model_column : Int32, editable : Int32 | ModelColumn, color_model_column : Int32) : Nil
-
#append_text_column(name : String, text_model_column : Int32, editable : Int32 | ModelColumn) : Nil
editablecan be:never,:always, or a model column whose values control editability for each row. -
#clear_on_header_clicked : Nil
Clears the callback; equivalent to
#on_header_clicked(nil). -
#clear_on_row_clicked : Nil
Clears the callback; equivalent to
#on_row_clicked(nil). -
#clear_on_row_double_clicked : Nil
Clears the callback; equivalent to
#on_row_double_clicked(nil). -
#clear_on_selection_changed : Nil
Clears the callback; equivalent to
#on_selection_changed(nil). - #column_set_width(column : Int32, width : Int32) : Nil
- #column_width(column : Int32) : Int32
-
#each_selected_index(&block : Int32 -> _) : Nil
Yields each selected row index without copying the native row array into a Crystal Array.
- #header_set_sort_indicator(column : Int32, sort_indicator : SortIndicator) : Nil
- #header_sort_indicator(column : Int32) : SortIndicator
- #header_visible=(value : Bool)
- #header_visible? : Bool
- #on_header_clicked(&block : LibC::Int -> Nil) : Nil
- #on_header_clicked(callback : Nil) : Nil
- #on_row_clicked(&block : LibC::Int -> Nil) : Nil
- #on_row_clicked(callback : Nil) : Nil
- #on_row_double_clicked(&block : LibC::Int -> Nil) : Nil
- #on_row_double_clicked(callback : Nil) : Nil
- #on_selection_changed(&block : Selection -> Nil) : Nil
- #on_selection_changed(callback : Nil) : Nil
- #selection : Selection
- #selection=(selection : Selection) : Nil
- #selection_mode : Selection::Mode
- #selection_mode=(mode : Selection::Mode) : Nil
- #to_unsafe
Instance methods inherited from class UIng::Control
delete(child : Control)
delete,
destroy : Nil
destroy,
detach : self
detach,
disable : Nil
disable,
enable : Nil
enable,
enabled? : Bool
enabled?,
enabled_to_user? : Bool
enabled_to_user?,
handle : Pointer(Void)
handle,
hide : Nil
hide,
parent : Control | Nil
parent,
released? : Bool
released?,
set_minimum_size(width : Int32, height : Int32) : Nil
set_minimum_size,
show : Nil
show,
to_unsafe
to_unsafe,
tooltip=(tooltip : String) : Niltooltip=(tooltip : Nil) : Nil tooltip=, toplevel? : Bool toplevel?, visible? : Bool visible?
Macros inherited from module UIng::BlockConstructor
block_constructor
block_constructor
Constructor Detail
IMPORTANT: This method accepts Table::Model instead of Table::Params
Instance Method Detail
clickable follows the same rules as column editability.
editable can be :never, :always, or a model column whose values
control editability for each row.
Clears the callback; equivalent to #on_row_double_clicked(nil).
Clears the callback; equivalent to #on_selection_changed(nil).
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.