Method: Muby::InputWindow#update

Defined in:
lib/muby/inputwindow.rb

#updateObject

Update the input box, redrawing borders and text etc.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/muby/inputwindow.rb', line 100

def update
  @inputBorder.box(0,0)
  @inputBorder.mvwprintw(0,1,"%s", @statusLine)
  @inputBorder.mvwprintw(height - 1, 1, "%s", @messageLine)
  @inputBorder.refresh

  @inputWindow.werase
  row = 0
  col = @cursorPosition
  while col > width - 2
    row = row + 1
    col = col - width - 2
  end
  @inputWindow.mvwprintw(row,col,"%s", @buffer[@cursorPosition,@buffer.size - @cursorPosition])
  @inputWindow.mvwprintw(0,0,"%s", @buffer[0, @cursorPosition])
  @inputWindow.refresh
end