Class: Tuile::Component::LogWindow
- Defined in:
- lib/tuile/component/log_window.rb,
sig/tuile.rbs
Overview
A Window framing a LogTextView — the framed log pane. All the log behavior lives on the view (see LogTextView for the adapter and the wrap rationale); the window adds the border, caption and delegation:
log_window = Tuile::Component::LogWindow.new
logger = Logger.new(Tuile::Component::LogWindow::IO.new(log_window))
Constant Summary collapse
- IO =
Alias of Tuile::Component::LogTextView::IO, which accepts the window itself as its sink.
LogTextView::IO
Instance Attribute Summary
Attributes inherited from Window
Attributes included from HasContent
Instance Method Summary collapse
-
#initialize(caption = "Log") ⇒ LogWindow
constructor
@param
caption. -
#log(string) ⇒ void
Appends the given line to the log, from any thread — delegates to Tuile::Component::LogTextView#log.
Methods inherited from Window
#bottom_border, #caption, #caption=, #focusable?, #footer, #footer=, #layout, #layout_footer, #on_focus, #rect=, #repaint, #repaint_border, #scrollbar=, #top_border
Methods included from HasCaption
Methods included from HasContent
Constructor Details
#initialize(caption = "Log") ⇒ LogWindow
@param caption
17 18 19 20 |
# File 'lib/tuile/component/log_window.rb', line 17 def initialize(caption = "Log") super self.content = LogTextView.new end |
Instance Method Details
#log(string) ⇒ void
This method returns an undefined value.
Appends the given line to the log, from any thread — delegates to Tuile::Component::LogTextView#log.
@param string — the line (or multiple lines) to log; nil is a no-op.
27 28 29 |
# File 'lib/tuile/component/log_window.rb', line 27 def log(string) content.log(string) end |