Class: RETerm::Components::Label

Inherits:
RETerm::Component show all
Defined in:
lib/reterm/components/label.rb

Overview

Simply renders text to window

Instance Attribute Summary

Attributes inherited from RETerm::Component

#window

Instance Method Summary collapse

Methods inherited from RETerm::Component

#activatable?, #activate!, #colored?, #colors=, #finalize!

Constructor Details

#initialize(args = {}) ⇒ Label

Initialize the Label component

Parameters:

  • args (Hash) (defaults to: {})

    label params

Options Hash (args):

  • :text (String)

    text of button



10
11
12
# File 'lib/reterm/components/label.rb', line 10

def initialize(args={})
  @text    = args[:text] || ""
end

Instance Method Details

#draw!Object



14
15
16
17
# File 'lib/reterm/components/label.rb', line 14

def draw!
  window.mvaddstr(1, 1, @text)
  update_reterm
end