class TkComponent::Builder::TkItemWithVariable

Attributes

tk_variable[RW]

Public Class Methods

new(parent_item, name, options = {}, grid = {}, event_handlers = []) click to toggle source
Calls superclass method TkComponent::Builder::TkItem::new
# File lib/tk_component/builder/tk_item.rb, line 108
def initialize(parent_item, name, options = {}, grid = {}, event_handlers = [])
  create_variable
  super
  apply_variable
end

Public Instance Methods

apply_variable() click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 118
def apply_variable
  self.native_item&.public_send(variable_name, @tk_variable)
end
create_variable() click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 122
def create_variable
  @tk_variable = TkVariable.new
end
variable_name() click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 114
def variable_name
  :variable
end