Class: Cura::Window
- Inherits:
-
Object
- Object
- Cura::Window
- Includes:
- Attributes::HasApplication, Attributes::HasCoordinates, Attributes::HasDimensions, Attributes::HasEvents, Attributes::HasInitialize, Attributes::HasRoot
- Defined in:
- lib/cura/window.rb
Overview
A window containing a drawing area.
Instance Attribute Summary
Attributes included from Attributes::HasEvents
Attributes included from Attributes::HasApplication
Instance Method Summary collapse
-
#draw ⇒ Window
Draw this window’s children.
-
#hide ⇒ Window
Hide this window.
-
#initialize(attributes = {}) ⇒ Window
constructor
A new instance of Window.
-
#inspect ⇒ String
Instance inspection.
-
#parent ⇒ Window
Return this window’s parent.
-
#show ⇒ Window
Show this window.
-
#update ⇒ Window
Update this window’s components.
Methods included from Attributes::HasRoot
#add_child, #add_children, #children, #children?, #delete_child, #delete_child_at, #delete_children, #root, #root=
Methods included from Attributes::HasAttributes
Methods included from Attributes::HasEvents
Methods included from Attributes::HasDimensions
#height, #height=, #resize, #width, #width=
Methods included from Attributes::HasCoordinates
Constructor Details
#initialize(attributes = {}) ⇒ Window
Returns a new instance of Window.
26 27 28 29 30 |
# File 'lib/cura/window.rb', line 26 def initialize(attributes={}) super @focus_controller = FocusController.new(window: self) end |
Instance Method Details
#draw ⇒ Window
Draw this window’s children.
44 45 46 47 48 49 50 |
# File 'lib/cura/window.rb', line 44 def draw application.adapter.clear @root.draw application.adapter.present self end |
#hide ⇒ Window
Hide this window.
62 63 64 |
# File 'lib/cura/window.rb', line 62 def hide self # TODO end |
#inspect ⇒ String
Instance inspection.
76 77 78 |
# File 'lib/cura/window.rb', line 76 def inspect "#<#{self.class}:0x#{__id__.to_s(16)} application=#{@application.class}:0x#{@application.__id__.to_s(16)}>" end |
#parent ⇒ Window
Return this window’s parent.
69 70 71 |
# File 'lib/cura/window.rb', line 69 def parent # TODO: Needed? @application end |
#show ⇒ Window
Show this window.
55 56 57 |
# File 'lib/cura/window.rb', line 55 def show self # TODO end |
#update ⇒ Window
Update this window’s components.
35 36 37 38 39 |
# File 'lib/cura/window.rb', line 35 def update @root.update self end |