Sha256: 7a3066f29ecbe023db59a0795cfe70e34d2d2b578f25975509879068bf11f64d

Contents?: true

Size: 668 Bytes

Versions: 17

Compression:

Stored size: 668 Bytes

Contents

require 'rubytext'

RubyText.start(fg: White, bg: Black)

def any_key
  STDSCR.bottom
  print " "*30 + "Press any key..."
  getch
end

puts "Colors...\n "  # window must be >= 96 cols?

r0 = 3
Colors.each do |fg|
  c0 = 0
  Colors.each do |bg|
    win = RubyText.window(2, 12, r0, c0, border: false, fg: fg, bg: bg)
    win.puts " #{fg} on\n #{bg}"
    c0 += 14
  end
  r0 += 3
end

any_key

STDSCR.clear

15.times { puts }

puts "Here is some"
puts "  random text...\n "
sleep 2.5

STDSCR.scrolling(true)

puts "Scroll up 3..."
3.times { STDSCR.scroll; sleep 0.9 }

sleep 0.9

puts "... now scroll down 5."
5.times { STDSCR.scroll(-1); sleep 0.9 }

sleep 0.9
any_key

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rubytext-0.0.84 examples/multitest.rb
rubytext-0.0.83 examples/multitest.rb
rubytext-0.0.82 examples/multitest.rb
rubytext-0.0.81 examples/multitest.rb
rubytext-0.0.80 examples/multitest.rb
rubytext-0.0.79 examples/multitest.rb
rubytext-0.0.78 examples/multitest.rb
rubytext-0.0.77 examples/multitest.rb
rubytext-0.0.76 examples/multitest.rb
rubytext-0.0.75 examples/multitest.rb
rubytext-0.0.74 examples/multitest.rb
rubytext-0.0.73 examples/multitest.rb
rubytext-0.0.72 examples/multitest.rb
rubytext-0.0.71 examples/multitest.rb
rubytext-0.0.70 examples/multitest.rb
rubytext-0.0.69 examples/multitest.rb
rubytext-0.0.68 examples/multitest.rb