# class TkMenubar

### Public Class Methods

new(parent = nil, spec = nil, options = {}) click to toggle source
Calls superclass method TkComposite.new

    # File lib/tk/menubar.rb, line 97
    def initialize(parent = nil, spec = nil, options = {})
      if parent.kind_of? Hash
        options = parent
        parent = nil
        spec = (options.has_key?('spec'))? options.delete('spec'): nil
      end

      _symbolkey2str(options)
      menuspec_opt = {}
      TkMenuSpec::MENUSPEC_OPTKEYS.each{|key|
        menuspec_opt[key] = options.delete(key) if options.has_key?(key)
      }

      super(parent, options)

      @menus = []

      spec.each{|info| add_menu(info, menuspec_opt)} if spec

      options.each{|key, value| configure(key, value)} if options
    end

### Public Instance Methods

[](index) click to toggle source

    # File lib/tk/menubar.rb, line 135
    def [](index)
      return @menus[index]
    end