class

Opal::UI::Box

Inherits Opal::UI::Element < Opal::UI::Themable < Reference < Object

Container component providing border, padding, and an optional embedded title.

Constructors

new(child : Element | Nil = nil, border : Symbol | Border | String | Nil = nil, border_fg : Color | Symbol | String | Nil = nil, padding : Int32 = 0, title : String | Nil = nil, title_fg : Color | Symbol | String | Nil = nil, bg : Color | Symbol | String = Color.none)
Source
new(border : Symbol | Border | String | Nil = nil, border_fg : Color | Symbol | String | Nil = nil, padding : Int32 = 0, title : String | Nil = nil, title_fg : Color | Symbol | String | Nil = nil, bg : Color | Symbol | String = Color.none, &)
Source

Class methods

to_string(text : String, title : String | Nil = nil, border : Symbol | Border | String = :rounded, border_fg : Color | Symbol | String = Color.none, padding : Int32 = 1, width : Int32 | Nil = nil, color : Bool | Nil = nil, theme : Theme | Nil = nil) : String

Class convenience method returning styled box string

Source

Instance methods

<<(element : Element) : self

Shovel alias for add

Source
add(element : Element) : self

Appends a child element to the box. If a child already exists, wraps both in a VStack.

Source
bg=(bg : Color)
Source
border
Source
border=(border : Border | Nil)
Source
border_fg
Source
border_fg=(border_fg : Color | Nil)
Source
child
Source
child=(child : Element | Nil)
Source
children

Returns child elements for hierarchical tree traversal and DOM querying

Source
padding_bottom
Source
padding_bottom=(padding_bottom : Int32)
Source
padding_left
Source
padding_left=(padding_left : Int32)
Source
padding_right
Source
padding_right=(padding_right : Int32)
Source
padding_top
Source
padding_top=(padding_top : Int32)
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source
title
Source
title=(title : String | Nil)
Source
title_fg
Source
title_fg=(title_fg : Color | Nil)
Source