Module: Tk::SystemMenu

Included in:
SysMenu_Apple, SysMenu_Help, SysMenu_System
Defined in:
ext/lib/tk/menu.rb

Instance Method Summary collapse

Instance Method Details

#initialize(parent, keys = nil) ⇒ Object



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# File 'ext/lib/tk/menu.rb', line 452

def initialize(parent, keys=nil)
  if parent.kind_of? Hash
    keys = _symbolkey2str(parent)
    parent = keys.delete('parent')
  end
  #unless parent.kind_of? TkMenu
  #  fail ArgumentError, "parent must be a TkMenu object"
  #end
  # @path = Kernel.format("%s.%s", parent.path, self.class::SYSMENU_NAME)
  @path = parent.path + '.' + self.class::SYSMENU_NAME
  #TkComm::Tk_WINDOWS[@path] = self
  TkCore::INTERP.tk_windows[@path] = self
  if self.method(:create_self).arity == 0
    p 'create_self has no arg' if $DEBUG
    create_self
    configure(keys) if keys
  else
    p 'create_self has an arg' if $DEBUG
    create_self(keys)
  end
end