class UIng::Table::Model::Handler

Overview

Table model callbacks with closure support. Model retains the Handler and its Procs; native UserData points back to it. Direct LibUI callers must retain the Handler themselves.

Column count and types are sealed when first passed to libui-ng. cell_value returns a new owned Value (or nil where allowed), transferred to libui-ng. set_cell_value receives a borrowed Value?, valid only during that callback. Keep captured native resources unfreed while used.

Included Modules

Defined in:

uing/table/model/handler.cr

Constructors

Instance Method Summary

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 #

Ameba counts branches inside the C callback closures as branches of this initializer even though each closure is an independent handler. ameba:disable Metrics/CyclomaticComplexity


[View source]

Instance Method Detail

def cell_value(&block : LibC::Int, LibC::Int -> Value | Nil) #

[View source]
def clear_set_cell_value : Nil #

Removes the optional edit/click callback; equivalent to #set_cell_value(nil).


[View source]
def column_type(&block : LibC::Int -> Value::Type) #

[View source]
def num_columns(&block : -> Int32) #

[View source]
def num_rows(&block : -> Int32) #

[View source]
def set_cell_value(&block : LibC::Int, LibC::Int, Value | Nil -> Nil) #

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

[View source]
def to_unsafe #

[View source]