Opal::UI::Tree
Inherits Opal::UI::Control < Opal::UI::InputHookable < Opal::UI::Element < Opal::UI::Themable < Reference < Object
Renders an interactive hierarchical tree with branch connectors, expand/collapse support, keyboard navigation, and mouse selection.
Constructors
Class methods
print(root_nodes : Array(TreeNode), title : String | Nil = nil, io : IO = STDOUT, width : Int32 | Nil = nil, color : Bool | Nil = nil, theme : Theme | Nil = nil) : Nil
Class convenience method printing styled tree directly to IO
print(root_node : TreeNode, title : String | Nil = nil, io : IO = STDOUT, width : Int32 | Nil = nil, color : Bool | Nil = nil, theme : Theme | Nil = nil) : Nil
Overload printing a single root TreeNode directly to IO
Instance methods
add(node : TreeNode) : TreeNode
Sourceadd(label : String, color : Color | Symbol | String = :white, icon : String | Nil = nil, &) : TreeNode
SourceDefault key event handler. Override in subclasses if not using @default_input_proc.
Default mouse event handler. Override in subclasses if not using @default_input_proc.
on_select
Sourceon_toggle
SourcePreferred size in print mode: full line count
Render hook for print mode: clears selection highlight to render pure branch structure
root_nodes
Sourceselected_node
Sourceselected_node=(selected_node : TreeNode | Nil)
Sourcetitle
Source