Class: Smartdict::Gui::MenuBar

Inherits:
Gtk::MenuBar
  • Object
show all
Defined in:
lib/smartdict/gui/menu_bar.rb

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ MenuBar

Returns a new instance of MenuBar.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/smartdict/gui/menu_bar.rb', line 5

def initialize(controller)
  @controller = controller
  super()

  file_menu_item = Gtk::MenuItem.new("_File")

	file_exit_item = Gtk::MenuItem.new("_Exit")
	  file_exit_item.signal_connect("activate") {@controller.quit}
    file_export_item = Gtk::MenuItem.new("_Export")
      file_export_item.signal_connect("activate") { @controller.open_export_dialog }

	file_menu = Gtk::Menu.new
	file_menu.add(file_export_item)
	file_menu.add(file_exit_item)
	file_menu_item.submenu = file_menu

	help_menu_item = Gtk::MenuItem.new("_Help")

	  help_about_item = Gtk::MenuItem.new("About")
 help_about_item.signal_connect("activate"){ @controller.open_about_window }

	  help_menu = Gtk::Menu.new
	  help_menu.add(help_about_item)
	  help_menu_item.submenu = help_menu

  append(file_menu_item)
  append(help_menu_item)

end