class TkComponent::Builder::ScrollBar

Public Instance Methods

apply_option(option, v, to_item = self.native_item) click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 346
def apply_option(option, v, to_item = self.native_item)
  case option.to_sym
  when :linked_to
    @linked_to = v
  else
    super
  end
end
apply_options(options, to_item = self.native_item) click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 364
def apply_options(options, to_item = self.native_item)
  options.merge!(orient: orient)
  super
end
bind_linked_to() click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 374
def bind_linked_to
  return unless @linked_to.present?
  items = @linked_to.is_a?(Array) ? @linked_to.map(&:native_item) : [ @linked_to.native_item ]
  self.native_item.command proc { |*args|
    items.each do |item|
      item.send(scroll_command, *args)
    end
  }
  items.each do |item|
    item.send(linked_scroll_command, proc { |*args| self.native_item.send(linked_scroll_event, *args) })
  end
end
linked_scroll_command() click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 395
def linked_scroll_command
  raise "#{self.class.to_s} shouldn't be instantiated directly. Use 'H' or 'V' subclasses"
end
linked_scroll_event() click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 399
def linked_scroll_event
  raise "#{self.class.to_s} shouldn't be instantiated directly. Use 'H' or 'V' subclasses"
end
orient() click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 387
def orient
  raise "#{self.class.to_s} shouldn't be instantiated directly. Use 'H' or 'V' subclasses"
end
scroll_command() click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 391
def scroll_command
  raise "#{self.class.to_s} shouldn't be instantiated directly. Use 'H' or 'V' subclasses"
end
set_event_handler(event_handler) click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 355
def set_event_handler(event_handler)
  case event_handler.name
  when :change
    Event.Event.bind_command(event_handler.name, self, event_handler.options, event_handler.lambda)
  else
    super
  end
end
set_event_handlers(event_handlers) click to toggle source
# File lib/tk_component/builder/tk_item.rb, line 369
def set_event_handlers(event_handlers)
  bind_linked_to
  super
end