Class: TkComponent::Builder::TkWindow

Inherits:
TkItem
  • Object
show all
Defined in:
lib/tk_component/builder/tk_item.rb

Instance Attribute Summary

Attributes inherited from TkItem

#native_item

Instance Method Summary collapse

Methods inherited from TkItem

#apply_internal_grid, #apply_option, #apply_options, #built, create, #create_native_item, #native_item_class, #remove, #set_event_handler, #set_event_handlers, #set_grid

Constructor Details

#initialize(parent_item, name, options = {}, grid = {}, event_handlers = []) ⇒ TkWindow

Returns a new instance of TkWindow.



475
476
477
478
479
480
481
482
# File 'lib/tk_component/builder/tk_item.rb', line 475

def initialize(parent_item, name, options = {}, grid = {}, event_handlers = [])
  if (options.delete(:root))
    @native_item = TkRoot.new { title options[:title] }
  else
    @native_item = TkToplevel.new { title options[:title] }
  end
  apply_options(options)
end

Instance Method Details

#focusObject



484
485
486
# File 'lib/tk_component/builder/tk_item.rb', line 484

def focus
  self.native_item.set_focus
end