class TkComponent::RBrowserComponent

Attributes

data_source[RW]
max_columns[RW]
paned[RW]
selected_path[RW]

Public Class Methods

new(options = {}) click to toggle source
Calls superclass method TkComponent::Base::new
# File lib/tk_component/components/r_browser_component.rb, line 11
def initialize(options = {})
  super
  @data_source = options[:data_source]
  @selected_path = options[:selected_path] || []
  @paned = !!options[:paned]
  @max_columns = options[:max_columns]
end

Public Instance Methods

render(p, parent_component) click to toggle source
# File lib/tk_component/components/r_browser_component.rb, line 19
def render(p, parent_component)
  p.insert_component(TkComponent::BrowserColumnComponent, self,
                     browser: self,
                     column_index: 0,
                     sticky: 'nsew', x_flex: 1, y_flex: 1) do |bc|
    bc.on_event 'ItemSelected', ->(e) do
      puts "ItemSelected"
      emit('PathChanged')
    end
  end
end