Sha256: 38c6e93349ff10f3383143d291471a8d0b79df7378e92915875127ac5e40c9f4

Contents?: true

Size: 1.35 KB

Versions: 8

Compression:

Stored size: 1.35 KB

Contents

#!/usr/bin/env ruby

lib_dir = File.dirname(__FILE__) + '/../../lib'
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)

-> { its -> { a } }
trap('INT') { exit! }

require 'vedeu'

class VedeuLinesApp
  include Vedeu

  event(:_initialize_) { trigger(:_refresh_) }

  interface 'ruthenium' do
    centred true
    colour  foreground: '#ffffff', background: '#000000'
    height  5
    width   40
  end

  interface 'tantalum' do
    colour  foreground: '#00aadd', background: '#000000'
    height  1
    width   40
    x       use('ruthenium').left
    y       use('ruthenium').south
  end

  keys do
    key(:up)    { trigger(:_cursor_up_)    }
    key(:right) { trigger(:_cursor_right_) }
    key(:down)  { trigger(:_cursor_down_)  }
    key(:left)  { trigger(:_cursor_left_)  }
  end

  render do
    view 'ruthenium' do
      line 'Ruthenium is a chemical element with'
      line 'symbol Ru and atomic number 44. It is a'
      line 'rare transition metal belonging to the'
      line 'platinum group of the periodic table.'
      line 'Like the other metals of the platinum'
      line 'group, ruthenium is inert to most other'
      line 'chemicals.'
    end
    view 'tantalum' do
      line 'Use cursor keys to navigate, Q to quit.'
    end
  end

  focus 'ruthenium'

  def self.start
    Vedeu::Launcher.new(['--debug']).execute!
  end
end

VedeuLinesApp.start

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vedeu-0.2.9 examples/lines_app/lines_app.rb
vedeu-0.2.8 examples/lines_app/lines_app.rb
vedeu-0.2.7 examples/lines_app/lines_app.rb
vedeu-0.2.6 examples/lines_app/lines_app.rb
vedeu-0.2.5 examples/lines_app/lines_app.rb
vedeu-0.2.4 examples/lines_app/lines_app.rb
vedeu-0.2.3 examples/lines_app/lines_app.rb
vedeu-0.2.2 examples/lines_app/lines_app.rb