Class: Zgomot::UI::TitleWindow
- Includes:
- Utils
- Defined in:
- lib/zgomot/ui/windows.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#text_color ⇒ Object
readonly
Returns the value of attribute text_color.
-
#top ⇒ Object
readonly
Returns the value of attribute top.
Instance Method Summary collapse
- #display ⇒ Object
-
#initialize(text, color, top, text_color = nil) ⇒ TitleWindow
constructor
A new instance of TitleWindow.
Methods included from Utils
Constructor Details
#initialize(text, color, top, text_color = nil) ⇒ TitleWindow
Returns a new instance of TitleWindow.
413 414 415 416 417 |
# File 'lib/zgomot/ui/windows.rb', line 413 def initialize(text, color, top, text_color = nil) @text_color = text_color || color @text, @color, @top = text, color, top display end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
412 413 414 |
# File 'lib/zgomot/ui/windows.rb', line 412 def color @color end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
412 413 414 |
# File 'lib/zgomot/ui/windows.rb', line 412 def text @text end |
#text_color ⇒ Object (readonly)
Returns the value of attribute text_color.
412 413 414 |
# File 'lib/zgomot/ui/windows.rb', line 412 def text_color @text_color end |
#top ⇒ Object (readonly)
Returns the value of attribute top.
412 413 414 |
# File 'lib/zgomot/ui/windows.rb', line 412 def top @top end |
Instance Method Details
#display ⇒ Object
418 419 420 421 422 423 424 425 426 427 428 |
# File 'lib/zgomot/ui/windows.rb', line 418 def display set_color(color) { write(top, 0, '-' * WIDTH) write(top + 1, 0, '|') write(top + 1, WIDTH-1, '|') write(top + 2, 0, '-' * WIDTH) } set_color(text_color) { write(top + 1, 1, text.center(WIDTH-2)) } end |