class Canis::DefaultRenderer

An extension of Abstracttextpadrenderer which takes care of AbstractChunkLine objects

calling their +print+ method.

Public Instance Methods

render(pad, lineno, text) click to toggle source

default method for rendering a line If it is a chunkline, then we take care of it. Only if it is a String do we pass to renderer. Should a renderer be allowed to handle chunks. Or be yielded chunks?

# File lib/canis/core/widgets/textpad.rb, line 1590
def render pad, lineno, text
  if text.is_a? AbstractChunkLine
    text.print pad, lineno, 0, @content_cols, color_pair, attr
    return
  end
  ## messabox does have a method to paint the whole window in bg color its in rwidget.rb
  att = NORMAL
  FFI::NCurses.wattron(pad, @cp | att)
  FFI::NCurses.mvwaddstr(pad, lineno, 0, @clearstring) if @clearstring
  FFI::NCurses.mvwaddstr(pad, lineno, 0, @list[lineno])

  #FFI::NCurses.mvwaddstr(pad, lineno, 0, text)
  FFI::NCurses.wattroff(pad, @cp | att)
end