class Peridot::UI::Window

Overview

Represents a termbox container used as a window within the UI

Direct Known Subclasses

Defined in:

ui.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(title : String, dimensions : NamedTuple(x: Int32, y: Int32, w: Int32, h: Int32), lines : Array(String)) #

[View source]
def self.new(title : String, dimensions : NamedTuple(x: Int32, y: Int32, w: Int32, h: Int32)) #

[View source]

Instance Method Detail

def add #

[View source]
def container : Peridot::TContainer #

[View source]
def current_line : String #

[View source]
def deselect #

[View source]
def draw #

[View source]
def filter(arg) #

[View source]
def filtered? : Bool #

[View source]
def lines : Array(String) #

[View source]
def lines=(lines : Array(String)) #

[View source]
def play #

Defined Here to be overriden in child classes


[View source]
def resize(dimensions) #

[View source]
def select #

[View source]
def selected_line : Int32 #

[View source]
def selected_line=(selected_line : Int32) #

[View source]
def title=(title : String) #

[View source]
def unfilter #

[View source]
def update #

Defined Here to be overriden in child classes


[View source]
def write_line(text : String, line : Int32, fg : Int32, bg : Int32) #

Writes the line using the given colors


[View source]
def write_line(text : String, line : Int32) #

Note: This will truncate the lines if they extend beyond the containers boundary


[View source]
def write_lines(lines : Array(String), selected_index : Int32) #

Writes lines with the selected line highlighted


[View source]
def write_lines(lines : Array(String)) #

Note: This will truncate the lines if they extend beyond the containers boundary


[View source]