Class: MittensUi::FileMenu

Inherits:
Core
  • Object
show all
Defined in:
lib/mittens_ui/file_menu.rb

Instance Attribute Summary

Attributes inherited from Core

#core_widget

Instance Method Summary collapse

Methods inherited from Core

#hidden?, #hide, #remove, #show

Methods included from Helpers

#icon_map, #list_system_icons, #set_margin_from_opts_for

Constructor Details

#initialize(menu_items, options = {}) ⇒ FileMenu

Returns a new instance of FileMenu.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/mittens_ui/file_menu.rb', line 5

def initialize(menu_items, options = {})
  @menu_items = menu_items

  @menu_bar = Gtk::MenuBar.new

  # menu_name => menu_item(gtk)
  @raw_menu_items = {}

  associate_menu_items

  create_menu_methods

  super(@menu_bar, options)
end

Instance Method Details

#renderObject



20
21
22
23
# File 'lib/mittens_ui/file_menu.rb', line 20

def render
  $vertical_box.pack_start(@menu_bar)
  return self
end