Class: Curses::Window

Inherits:
Object show all
Defined in:
lib/salticid/interface/ncurses.rb

Instance Method Summary collapse

Instance Method Details

#add_formatted_string(string) ⇒ Object

Adds a FormattedString



9
10
11
12
13
14
15
16
17
# File 'lib/salticid/interface/ncurses.rb', line 9

def add_formatted_string(string)
  string.each do |part|
    # Set attributes
    part[1..-1].each {| attribute| attron attribute }
    addstr part[0]
    # Unset attributes
    part[1..-1].each {| attribute| attroff attribute }
  end
end

#cursorObject

Returns cursor y and x coordinates.



20
21
22
# File 'lib/salticid/interface/ncurses.rb', line 20

def cursor
  [cury, curx]
end