Sha256: da68b0b12c2fe6fd079302175c0663fed0a71d0df8d8c424a273a3e3ecf3ff55

Contents?: true

Size: 798 Bytes

Versions: 28

Compression:

Stored size: 798 Bytes

Contents

%w[xot rays reflex]
  .map  {|s| File.expand_path "../../#{s}/lib", __dir__}
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}

require 'reflex'


lines = File.readlines(__FILE__)


win = Reflex::Window.new do
  set title: "Rays/Reflex Text Test", frame: [100, 100, 600, 400]
  painter.background 0.1
  painter.font Reflex::Font.new 'Menlo', 12
  on :draw do |e|
    e.painter.push do
      linenum       = "%5d "
      linenum_width = font.width(linenum % 0).ceil
      line_height   = (font.height * 1.0).ceil

      fill 0.3
      rect 0, 0, linenum_width, 10000

      fill 1 #rand, rand, rand, 1
      lines.each.with_index do |line, i|
        text "#{linenum % i} #{line.chomp}"
        translate 0, line_height
      end
    end
  end
end


Reflex.start do
  win.show
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
reflexion-0.3.3 samples/text.rb
reflexion-0.3.2 samples/text.rb
reflexion-0.3.1 samples/text.rb
reflexion-0.3 samples/text.rb
reflexion-0.2.1 samples/text.rb
reflexion-0.2 samples/text.rb
reflexion-0.1.57 samples/text.rb
reflexion-0.1.56 samples/text.rb
reflexion-0.1.55 samples/text.rb
reflexion-0.1.54 samples/text.rb
reflexion-0.1.53 samples/text.rb
reflexion-0.1.52 samples/text.rb
reflexion-0.1.51 samples/text.rb
reflexion-0.1.50 samples/text.rb
reflexion-0.1.49 samples/text.rb
reflexion-0.1.48 samples/text.rb
reflexion-0.1.47 samples/text.rb
reflexion-0.1.46 samples/text.rb
reflexion-0.1.45 samples/text.rb
reflexion-0.1.44 samples/text.rb