Class: TkComponent::RBrowserComponent
- Defined in:
- lib/tk_component/components/r_browser_component.rb
Instance Attribute Summary collapse
-
#data_source ⇒ Object
Returns the value of attribute data_source.
-
#max_columns ⇒ Object
Returns the value of attribute max_columns.
-
#paned ⇒ Object
Returns the value of attribute paned.
-
#selected_path ⇒ Object
Returns the value of attribute selected_path.
Attributes inherited from Base
#children, #node, #parent, #parent_node, #tk_item
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RBrowserComponent
constructor
A new instance of RBrowserComponent.
- #render(p, parent_component) ⇒ Object
Methods inherited from Base
#add_child, #build, #component_did_build, #emit, #generate, #name, #parse_component, #parse_nodes, #rebuild, #regenerate, #regenerate_after_node, #regenerate_from_index, #regenerate_from_node
Methods included from BasicComponent
Constructor Details
#initialize(options = {}) ⇒ RBrowserComponent
Returns a new instance of RBrowserComponent.
11 12 13 14 15 16 17 |
# File 'lib/tk_component/components/r_browser_component.rb', line 11 def initialize( = {}) super @data_source = [:data_source] @selected_path = [:selected_path] || [] @paned = !![:paned] @max_columns = [:max_columns] end |
Instance Attribute Details
#data_source ⇒ Object
Returns the value of attribute data_source.
6 7 8 |
# File 'lib/tk_component/components/r_browser_component.rb', line 6 def data_source @data_source end |
#max_columns ⇒ Object
Returns the value of attribute max_columns.
9 10 11 |
# File 'lib/tk_component/components/r_browser_component.rb', line 9 def max_columns @max_columns end |
#paned ⇒ Object
Returns the value of attribute paned.
8 9 10 |
# File 'lib/tk_component/components/r_browser_component.rb', line 8 def paned @paned end |
#selected_path ⇒ Object
Returns the value of attribute selected_path.
7 8 9 |
# File 'lib/tk_component/components/r_browser_component.rb', line 7 def selected_path @selected_path end |
Instance Method Details
#render(p, parent_component) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# 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 |