examples/geometry_app.rb in vedeu-0.4.56 vs examples/geometry_app.rb in vedeu-0.4.57
- old
+ new
@@ -10,20 +10,18 @@
#
# ./examples/geometry_app.rb
#
class VedeuGeometryApp
- include Vedeu
-
# Be aware that running an application with debugging enabled will affect
# performance.
- configure do
+ Vedeu.configure do
# debug!
log '/tmp/vedeu_geometry_app.log'
end
- interface 'main_interface' do
+ Vedeu.interface 'main_interface' do
colour foreground: '#ff0000', background: '#000000'
cursor!
# Geometry can be defined within the interface.
geometry do
@@ -32,24 +30,24 @@
x 2
y 2
end
end
- interface 'second' do
+ Vedeu.interface 'second' do
colour foreground: '#0000ff', background: '#000000'
cursor!
end
# Geometry can be defined either before or after the interface.
- geometry 'second' do
+ Vedeu.geometry 'second' do
height 8
width columns(1)
x 12
y 2
end
- keymap('_global_') do
+ Vedeu.keymap('_global_') do
key(:up, 'k') { Vedeu.trigger(:_cursor_up_) }
key(:right, 'l') { Vedeu.trigger(:_cursor_right_) }
key(:down, 'j') { Vedeu.trigger(:_cursor_down_) }
key(:left, 'h') { Vedeu.trigger(:_cursor_left_) }
@@ -57,11 +55,11 @@
key(:escape) { Vedeu.trigger(:_mode_switch_) }
key(:shift_tab) { Vedeu.trigger(:_focus_prev_) }
key(:tab) { Vedeu.trigger(:_focus_next_) }
end
- renders do
+ Vedeu.renders do
view 'second' do
border!
lines do
line 'A.987654321'
line 'B.987654321'
@@ -136,14 +134,14 @@
end
end
end
end
- focus_by_name 'main_interface'
+ Vedeu.focus_by_name 'main_interface'
def self.start(argv = ARGV)
Vedeu::Launcher.execute!(argv)
end
-end
+end # VedeuGeometryApp
VedeuGeometryApp.start(ARGV)