struct CryTUI::Widgets::List

Defined in:

crytui/widgets.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(items : Array(CryTUI::Widgets::ListItem), style : CryTUI::Style = Style.new, highlight_style : CryTUI::Style = Style.new, block : CryTUI::Widgets::Block | Nil = nil) #

[View source]

Class Method Detail

def self.visible_offset(heights : Array(Int32), selected : Int32 | Nil, height : Int32, offset : Int32 = 0) : Int32 #

The index of the first item the list will draw, from the item heights, the selection, and the rows available. Anything that needs to know where an item ended up on screen -- hit testing, most obviously -- has to reach the same answer the renderer did, so both come through here.


[View source]

Instance Method Detail

def block : Block | Nil #

[View source]
def highlight_style : Style #

[View source]
def items : Array(ListItem) #

[View source]
def render(area : Rect, buffer : Buffer, state : ListState) #

[View source]
def style : Style #

[View source]