Method: RubyText::Window#putch

Defined in:
lib/output.rb

#putch(ch, r: nil, c: nil, fx: nil) ⇒ Object



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/output.rb', line 67

def putch(ch, r: nil, c: nil, fx: nil)
  debug("putch: #{[ch, r, c, fx].inspect}")
  if r.nil? && c.nil? && fx.nil?
    _putch(ch) 
  else
    r0, c0 = self.rc
    r ||= r0
    c ||= c0
    go(r, c) do
      fx.set(self) if fx
      val = fx.value rescue 0
      @cwin.addch(ch.ord|val)
    end
    fx.reset(self) if fx
  end
  @cwin.refresh
end