In Files

  • tk/lib/tk/menubar.rb

Parent

Methods

Included Modules

Class/Module Index [+]

Quicksearch

TkMenubar

Public Class Methods

new(parent = nil, spec = nil, options = nil) click to toggle 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) click to toggle source
 
               # File tk/lib/tk/menubar.rb, line 128
def [](index)
  return @menus[index]
end
            
add_menu(menu_info) click to toggle 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
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus