Module WidgetWrapper::Menus::MenuBar
In: widget_wrapper/lib/wx_wrapper/menu.rb

Menu bar syntax (This code follows after a frame block):

  menu_bar.menu "&File" do |item|
    item.add :new
    item.add :open
    item.separator
    item.add :save
    item.separator
    item.add :quit
  end

  menu_bar.menu "&Edit" do |item|
    item.add :undo
    item.add :redo
  end

The & in the menu title (ie &File) is used underlined and used as a shortcut for referencing alt command navigation for windows. You can move the ampersand in front of a different letter if you would like another letter to be the shortcut for alt keys. (As of yet, I don‘t know how this works in OS X if it has any effect at all).

Methods

menu   menus  

Public Instance methods

Creates a menu inside of the menu bar.

  menu_bar.menu "&File" do |item|
    item.add :new
  end

[Source]

    # File widget_wrapper/lib/wx_wrapper/menu.rb, line 62
62:       def menu(title, options = {})
63:         new_menu = Wx::Menu.new
64:         
65:         if block_given?
66:           yield(new_menu)
67:         end
68:         
69:         append(new_menu, title)
70:       end

Gets a list of menus in the menu bar

[Source]

    # File widget_wrapper/lib/wx_wrapper/menu.rb, line 53
53:       def menus
54:         (0..(get_menu_count-1)).collect {|menu_id| get_menu(menu_id)}
55:       end

[Validate]