Class: Tuile::Component::InfoWindow
- Inherits:
-
Window
- Object
- Tuile::Component
- Window
- Tuile::Component::InfoWindow
- Defined in:
- lib/tuile/component/info_window.rb
Overview
A Window preconfigured with a List of static lines. Useful for showing read-only information.
Usable tiled (just add to a Layout) or as a popup via InfoWindow.open, which wraps it in a Popup.
Instance Attribute Summary
Attributes inherited from Window
Attributes included from HasContent
Attributes inherited from Tuile::Component
Class Method Summary collapse
-
.open(caption, lines) ⇒ Popup
Opens the info window as a popup.
Instance Method Summary collapse
-
#initialize(caption = "", lines = []) ⇒ InfoWindow
constructor
A new instance of InfoWindow.
Methods inherited from Window
#children, #content_size, #focusable?, #handle_key, #handle_mouse, #key_shortcut=, #rect=, #repaint, #scrollbar=, #visible?
Methods included from HasContent
#children, #handle_key, #handle_mouse, #on_focus, #rect=
Methods inherited from Tuile::Component
#active=, #active?, #attached?, #children, #content_size, #cursor_position, #depth, #find_shortcut_component, #focus, #focusable?, #handle_key, #handle_mouse, #keyboard_hint, #on_child_removed, #on_focus, #on_tree, #repaint, #root, #screen
Constructor Details
#initialize(caption = "", lines = []) ⇒ InfoWindow
Returns a new instance of InfoWindow.
14 15 16 17 18 19 |
# File 'lib/tuile/component/info_window.rb', line 14 def initialize(caption = "", lines = []) super(caption) list = Component::List.new list.lines = lines self.content = list end |
Class Method Details
.open(caption, lines) ⇒ Popup
Opens the info window as a popup.
25 26 27 |
# File 'lib/tuile/component/info_window.rb', line 25 def self.open(caption, lines) Popup.open(content: InfoWindow.new(caption, lines)) end |