Class: TkInspect::CanvasWindow::Base
- Defined in:
- lib/tk_inspect/canvas_window/base.rb
Instance Attribute Summary collapse
-
#main_component ⇒ Object
Returns the value of attribute main_component.
-
#tk_root ⇒ Object
Returns the value of attribute tk_root.
Instance Method Summary collapse
- #create_root ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #new_turtle ⇒ Object
- #refresh ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
9 10 11 12 |
# File 'lib/tk_inspect/canvas_window/base.rb', line 9 def initialize @tk_root = nil @main_component = nil end |
Instance Attribute Details
#main_component ⇒ Object
Returns the value of attribute main_component.
5 6 7 |
# File 'lib/tk_inspect/canvas_window/base.rb', line 5 def main_component @main_component end |
#tk_root ⇒ Object
Returns the value of attribute tk_root.
4 5 6 |
# File 'lib/tk_inspect/canvas_window/base.rb', line 4 def tk_root @tk_root end |
Instance Method Details
#create_root ⇒ Object
19 20 21 22 23 24 |
# File 'lib/tk_inspect/canvas_window/base.rb', line 19 def create_root @tk_root = TkComponent::Window.new(title: "Canvas Window") @main_component = RootComponent.new @main_component.canvas_window = self @tk_root.place_root_component(@main_component) end |
#new_turtle ⇒ Object
26 27 28 |
# File 'lib/tk_inspect/canvas_window/base.rb', line 26 def new_turtle TkComponent::Turtle.new(canvas: main_component.canvas) end |
#refresh ⇒ Object
14 15 16 17 |
# File 'lib/tk_inspect/canvas_window/base.rb', line 14 def refresh @main_component.nil? ? create_root : @main_component.regenerate self end |