Class: Amun::Windows::Frame
- Defined in:
- lib/amun/windows/frame.rb
Overview
a Frame fills all the space in terminal renders an echo area or mini buffer if it exists and an object that respond to #render and #trigger, like buffer, or another window or so
Instance Attribute Summary collapse
-
#echo_area ⇒ Object
Returns the value of attribute echo_area.
-
#mini_buffer ⇒ Object
Returns the value of attribute mini_buffer.
-
#screen ⇒ Object
writeonly
Sets the attribute screen.
-
#window ⇒ Object
Returns the value of attribute window.
Attributes inherited from Base
Attributes inherited from Object
Instance Method Summary collapse
-
#initialize(size = default_size) ⇒ Frame
constructor
A new instance of Frame.
- #render ⇒ Object
- #set_size_to_terminal ⇒ Object
- #trigger(event) ⇒ Object
Constructor Details
#initialize(size = default_size) ⇒ Frame
Returns a new instance of Frame.
19 20 21 22 23 24 |
# File 'lib/amun/windows/frame.rb', line 19 def initialize(size = default_size) super(size) @window = BufferWindow.new(top_window_size) @echo_area = EchoArea.new(bottom_window_size) bind(Curses::KEY_RESIZE, self, :set_size_to_terminal) end |
Instance Attribute Details
#echo_area ⇒ Object
Returns the value of attribute echo_area.
16 17 18 |
# File 'lib/amun/windows/frame.rb', line 16 def echo_area @echo_area end |
#mini_buffer ⇒ Object
Returns the value of attribute mini_buffer.
16 17 18 |
# File 'lib/amun/windows/frame.rb', line 16 def mini_buffer @mini_buffer end |
#screen=(value) ⇒ Object (writeonly)
Sets the attribute screen
17 18 19 |
# File 'lib/amun/windows/frame.rb', line 17 def screen=(value) @screen = value end |
#window ⇒ Object
Returns the value of attribute window.
16 17 18 |
# File 'lib/amun/windows/frame.rb', line 16 def window @window end |
Instance Method Details
#render ⇒ Object
32 33 34 35 |
# File 'lib/amun/windows/frame.rb', line 32 def render render_window(window) render_window(bottom_area) end |
#set_size_to_terminal ⇒ Object
37 38 39 |
# File 'lib/amun/windows/frame.rb', line 37 def set_size_to_terminal(*) self.size = default_size end |
#trigger(event) ⇒ Object
26 27 28 29 30 |
# File 'lib/amun/windows/frame.rb', line 26 def trigger(event) EventManager.join(event, self.events, echo_area, mini_buffer || window, EventManager) rescue StandardError => error handle_exception(error) end |