Module: WindowIO

Defined in:
lib/output.rb

Instance Method Summary collapse

Instance Method Details

#getch ⇒ Object

FIXME These don't/can't honor @started flag...



280
281
282
# File 'lib/output.rb', line 280

def getch
  Curses.getch
end

#gets ⇒ Object

still needs improvement



284
285
286
287
# File 'lib/output.rb', line 284

def gets  # still needs improvement
  recv = RubyText.started ? $stdscr : Kernel
  recv.gets
end

#p(*args) ⇒ Object



268
269
270
271
# File 'lib/output.rb', line 268

def p(*args)
  recv = RubyText.started ? $stdscr : Kernel
  recv.p(*args)
end


263
264
265
266
# File 'lib/output.rb', line 263

def print(*args)
  recv = RubyText.started ? $stdscr : Kernel
  recv.print(*args)
end

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



289
290
291
292
293
294
# File 'lib/output.rb', line 289

def putch(ch, r: nil, c: nil, fx: nil)
  r, c = STDSCR.rc
  r ||= r0
  c ||= c0
  STDSCR.putch(ch, r: r, c: c, fx: fx)
end

#puts(*args) ⇒ Object

Doesn't affect STDOUT.puts, etc.



258
259
260
261
# File 'lib/output.rb', line 258

def puts(*args)       # Doesn't affect STDOUT.puts, etc.
  recv = RubyText.started ? $stdscr : Kernel
  recv.puts(*args)
end

#rcprint(r, c, *args) ⇒ Object



273
274
275
276
# File 'lib/output.rb', line 273

def rcprint(r, c, *args)
  recv = RubyText.started ? $stdscr : Kernel
  recv.rcprint r, c, *args
end