Class | TkMenubar
In: | tk/lib/tk/menubar.rb
Parent: | TkFrame

### Methods

[] add_menu new

### Included Modules

TkComposite TkMenuSpec

### Public Class methods

new(parent = nil, spec = nil, options = nil)

[Source]

    # File tk/lib/tk/menubar.rb, line 96
      def initialize(parent = nil, spec = nil, options = nil)
        if parent.kind_of? Hash
          options = _symbolkey2str(parent)
          spec = options.delete('spec')
          super(options)
        else
          super(parent, options)
        end

        @menus = []

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

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

### Public Instance methods

[](index)

[Source]

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

add_menu(menu_info)

[Source]

    # File tk/lib/tk/menubar.rb, line 112
      def add_menu(menu_info)
        mbtn, menu = _create_menubutton(@frame, menu_info)

        submenus = _get_cascade_menus(menu).flatten

        @menus.push([mbtn, menu])
        delegate('tearoff', menu, *submenus)
        delegate('foreground', mbtn, menu, *submenus)
        delegate('background', mbtn, menu, *submenus)
        delegate('disabledforeground', mbtn, menu, *submenus)
        delegate('activeforeground', mbtn, menu, *submenus)
        delegate('activebackground', mbtn, menu, *submenus)
        delegate('font', mbtn, menu, *submenus)
        delegate('kanjifont', mbtn, menu, *submenus)
      end

[Validate]