Class: TkComponent::Builder::TkTreeNode
- Defined in:
- lib/tk_component/builder/tk_item.rb
Instance Attribute Summary
Attributes inherited from TkItem
Instance Method Summary collapse
-
#initialize(parent_item, name, options = {}, grid = {}, event_handlers = []) ⇒ TkTreeNode
constructor
A new instance of TkTreeNode.
Methods inherited from TkItem
#apply_internal_grid, #apply_option, #apply_options, #built, create, #create_native_item, #focus, #native_item_class, #remove, #set_event_handler, #set_event_handlers, #set_grid
Constructor Details
#initialize(parent_item, name, options = {}, grid = {}, event_handlers = []) ⇒ TkTreeNode
Returns a new instance of TkTreeNode.
333 334 335 336 337 338 339 340 341 342 |
# File 'lib/tk_component/builder/tk_item.rb', line 333 def initialize(parent_item, name, = {}, grid = {}, event_handlers = []) = .dup parent_node = .delete(:parent) || '' parent_native_item = (parent_node == '' ? '' : parent_node.native_item) at = .delete(:at) selected = .delete(:selected) @native_item = parent_item.native_item.insert(parent_native_item, at, ) parent_item.native_item.selection_add(@native_item) if selected set_event_handlers(event_handlers) end |