Sha256: 625f8c0be8332e5c0c4306ea078c6837b1b16632945b157b84a9827be918163d
Contents?: true
Size: 1.98 KB
Versions: 1
Compression:
Stored size: 1.98 KB
Contents
#!/usr/bin/env ruby require 'bundler/setup' require 'vedeu' # An example application to demonstrate colours, cursor and interface movement, # maximising/unmaximising of interfaces and toggling of cursors and interfaces. # # If you have cloned this repository from GitHub, you can run this example: # # ./examples/material_colours_app.rb # # Running this application once, and immediately exiting produces the diagram # at `./examples/material_colours_app_20150721.svg`. Hopefully this will help # you to understand how parts of Vedeu work together. Questions are always # welcome at `https://github.com/gavinlaking/vedeu/issues` # class VedeuEditorApp Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) } # Be aware that running an application with debugging enabled will affect # performance. Vedeu.configure do debug! fake! log '/tmp/vedeu_editor_app.log' # renderers Vedeu::Renderers::File.new end Vedeu.interface 'main_interface' do border 'main_interface' do colour foreground: '#ffffff', background: :default title 'Editor' caption('Ctrl+C = Quit') end colour foreground: '#ffffff', background: :default cursor! geometry 'main_interface' do x columns(1) xn columns(11) y rows(1) yn rows(1) + 4 end zindex 1 end Vedeu.keymap('_global_') do key(:up) { Vedeu.trigger(:_cursor_up_) } key(:right) { Vedeu.trigger(:_cursor_right_) } key(:down) { Vedeu.trigger(:_cursor_down_) } key(:left) { Vedeu.trigger(:_cursor_left_) } key('q') { Vedeu.trigger(:_exit_) } key(:escape) { Vedeu.trigger(:_mode_switch_) } key(:shift_tab) { Vedeu.trigger(:_focus_prev_) } key(:tab) { Vedeu.trigger(:_focus_next_) } end Vedeu.renders do view 'main_interface' do line { line '' } end end Vedeu.focus_by_name 'main_interface' def self.start(argv = ARGV) Vedeu::Launcher.execute!(argv) end end # VedeuEditorApp VedeuEditorApp.start(ARGV)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.6.21 | test/support/examples/editor_app.rb |