Method: WindowBlessing.main

Defined in:
lib/window_blessing.rb

.main(&block) ⇒ Object



43
44
45
46
47
48
49
50
51
52
# File 'lib/window_blessing.rb', line 43

def main(&block)
  main_window = Window.new
  Screen.new.open do
    instance_exec(main_window, &block)
    on_tick do
      main_window.area = rect(screen_buffer.size)
      main_window.draw screen_buffer
    end
  end
end