class UIng::Table

Overview

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

Defined in:

uing/crimage.cr
uing/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

Instance Method Summary

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) : Nil
tooltip=(tooltip : Nil) : Nil
tooltip=
, toplevel? : Bool toplevel?, visible? : Bool visible?

Macros inherited from module UIng::BlockConstructor

block_constructor block_constructor

Constructor Detail

def self.new(*args, &) #

[View source]
def self.new(*args, **kwargs, &) #

[View source]
def self.new(model : Model, row_background_color_model_column : LibC::Int = -1) #

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


[View source]

Instance Method Detail

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

clickable follows the same rules as column editability.


[View source]
def append_checkbox_column(name : String, checkbox_model_column : Int32, editable : Int32 | ModelColumn) : Nil #

[View source]
def 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 #

[View source]
def 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 #

[View source]
def append_checkbox_text_column(name : String, checkbox_model_column : Int32, checkbox_editable : Int32 | ModelColumn, text_model_column : Int32, text_editable : Int32 | ModelColumn) : Nil #

[View source]
def append_image_column(name : String, image_model_column : Int32) : Nil #

[View source]
def append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, editable : Int32 | ModelColumn, table_text_column_optional_params : TextColumnOptionalParams) : Nil #

[View source]
def append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, editable : Int32 | ModelColumn, color_model_column : Int32) : Nil #

[View source]
def append_image_text_column(name : String, image_model_column : Int32, text_model_column : Int32, editable : Int32 | ModelColumn) : Nil #

[View source]
def append_progress_bar_column(name : String, progress_model_column : Int32) : Nil #

[View source]
def append_text_column(name : String, text_model_column : Int32, editable : Int32 | ModelColumn, table_text_column_optional_params : TextColumnOptionalParams) : Nil #

[View source]
def append_text_column(name : String, text_model_column : Int32, editable : Int32 | ModelColumn, color_model_column : Int32) : Nil #

[View source]
def 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.


[View source]
def clear_on_header_clicked : Nil #

Clears the callback; equivalent to #on_header_clicked(nil).


[View source]
def clear_on_row_clicked : Nil #

Clears the callback; equivalent to #on_row_clicked(nil).


[View source]
def clear_on_row_double_clicked : Nil #

Clears the callback; equivalent to #on_row_double_clicked(nil).


[View source]
def clear_on_selection_changed : Nil #

Clears the callback; equivalent to #on_selection_changed(nil).


[View source]
def column_set_width(column : Int32, width : Int32) : Nil #

[View source]
def column_width(column : Int32) : Int32 #

[View source]
def each_selected_index(&block : Int32 -> _) : 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.


[View source]
def header_set_sort_indicator(column : Int32, sort_indicator : SortIndicator) : Nil #

[View source]
def header_sort_indicator(column : Int32) : SortIndicator #

[View source]
def header_visible=(value : Bool) #

[View source]
def header_visible? : Bool #

[View source]
def on_header_clicked(&block : LibC::Int -> Nil) : Nil #

[View source]
def on_header_clicked(callback : Nil) : Nil #

[View source]
def on_row_clicked(&block : LibC::Int -> Nil) : Nil #

[View source]
def on_row_clicked(callback : Nil) : Nil #

[View source]
def on_row_double_clicked(&block : LibC::Int -> Nil) : Nil #

[View source]
def on_row_double_clicked(callback : Nil) : Nil #

[View source]
def on_selection_changed(&block : Selection -> Nil) : Nil #

[View source]
def on_selection_changed(callback : Nil) : Nil #

[View source]
def selection : Selection #

[View source]
def selection=(selection : Selection) : Nil #

[View source]
def selection_mode : Selection::Mode #

[View source]
def selection_mode=(mode : Selection::Mode) : Nil #

[View source]
def to_unsafe #

[View source]