Class: Curses::Window
- Inherits:
-
Object
- Object
- Curses::Window
- Defined in:
- lib/extentions.rb
Instance Method Summary collapse
Instance Method Details
#bold(&block) ⇒ Object
39 40 41 42 43 |
# File 'lib/extentions.rb', line 39 def bold(&block) attron(Curses::A_BOLD) block.call attroff(Curses::A_BOLD) end |
#with_color(fg, bg = :black, &block) ⇒ Object
45 46 47 48 49 50 |
# File 'lib/extentions.rb', line 45 def with_color(fg, bg = :black, &block) color_pair_index = Twterm::ColorManager.instance.get_color_pair_index(fg, bg) attron(Curses.color_pair(color_pair_index)) block.call attroff(Curses.color_pair(color_pair_index)) end |