class Cura::Window
A window containing a drawing area.
Public Class Methods
new(attributes={})
click to toggle source
Calls superclass method
Cura::Attributes::HasRoot::new
# File lib/cura/window.rb, line 26 def initialize(attributes={}) super @focus_controller = FocusController.new(window: self) end
Public Instance Methods
draw()
click to toggle source
Draw this window's children.
@return [Window]
# File lib/cura/window.rb, line 44 def draw application.adapter.clear @root.draw application.adapter.present self end
hide()
click to toggle source
Hide this window.
@return [Window]
# File lib/cura/window.rb, line 62 def hide self # TODO end
inspect()
click to toggle source
Instance inspection.
@return [String]
# File lib/cura/window.rb, line 92 def inspect "#<#{self.class}:0x#{__id__.to_s(16)} application=#{@application.class}:0x#{@application.__id__.to_s(16)}>" end
parent()
click to toggle source
Return this window's parent.
@return [Window]
# File lib/cura/window.rb, line 69 def parent # TODO: Needed? @application end
root=(value)
click to toggle source
Set root component for this object.
@param [Component::Group] component @return [Component::Group]
# File lib/cura/window.rb, line 77 def root=(value) raise TypeError, "root must be a Component::Group" unless value.is_a?(Component::Group) @root.parent = nil unless @root.nil? @root = value @root.parent = self @root.focus @root end
show()
click to toggle source
Show this window.
@return [Window]
# File lib/cura/window.rb, line 55 def show self # TODO end
update()
click to toggle source
Update this window's components.
@return [Window]
# File lib/cura/window.rb, line 35 def update @root.update self end