class TkInspect::CanvasWindow::Base

Attributes

main_component[RW]
tk_root[RW]

Public Class Methods

new() click to toggle source
# File lib/tk_inspect/canvas_window/base.rb, line 9
def initialize
  @tk_root = nil
  @main_component = nil
end

Public Instance Methods

create_root() click to toggle source
# 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() click to toggle source
# File lib/tk_inspect/canvas_window/base.rb, line 26
def new_turtle
  TkComponent::Turtle.new(canvas: main_component.canvas)
end
refresh() click to toggle source
# File lib/tk_inspect/canvas_window/base.rb, line 14
def refresh
  @main_component.nil? ? create_root : @main_component.regenerate
  self
end