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.
-
#windows ⇒ Object
readonly
Returns the value of attribute windows.
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.
340 341 342 343 344 |
# File 'lib/zgomot/ui/windows.rb', line 340 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.
339 340 341 |
# File 'lib/zgomot/ui/windows.rb', line 339 def color @color end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
339 340 341 |
# File 'lib/zgomot/ui/windows.rb', line 339 def text @text end |
#text_color ⇒ Object (readonly)
Returns the value of attribute text_color.
339 340 341 |
# File 'lib/zgomot/ui/windows.rb', line 339 def text_color @text_color end |
#top ⇒ Object (readonly)
Returns the value of attribute top.
339 340 341 |
# File 'lib/zgomot/ui/windows.rb', line 339 def top @top end |
#windows ⇒ Object (readonly)
Returns the value of attribute windows.
339 340 341 |
# File 'lib/zgomot/ui/windows.rb', line 339 def windows @windows end |
Instance Method Details
#display ⇒ Object
345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/zgomot/ui/windows.rb', line 345 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 |