- gtk_widget_destroy(dialog);
-}
-
-static void quit(GtkWidget *w, gpointer data)
-{
- gtk_main_quit();
-}
-
-static void imperial(GtkWidget *w, gpointer data)
-{
- output_units = IMPERIAL_units;
- repaint_dive();
-}
-
-static void metric(GtkWidget *w, gpointer data)
-{
- output_units = SI_units;
- repaint_dive();
-}
-
-static GtkActionEntry menu_items[] = {
- { "FileMenuAction", GTK_STOCK_FILE, "Log", NULL, NULL, NULL},
- { "OpenFile", GTK_STOCK_OPEN, NULL, "<control>O", NULL, G_CALLBACK(file_open) },
- { "SaveFile", GTK_STOCK_SAVE, NULL, "<control>S", NULL, G_CALLBACK(file_save) },
- { "Quit", GTK_STOCK_QUIT, NULL, "<control>Q", NULL, G_CALLBACK(quit) },
- { "Metric", NULL, "Metric", NULL, NULL, G_CALLBACK(metric) },
- { "Imperial", NULL, "Imperial", NULL, NULL, G_CALLBACK(imperial) },
-};
-static gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
-
-static const gchar* ui_string = " \
- <ui> \
- <menubar name=\"MainMenu\"> \
- <menu name=\"FileMenu\" action=\"FileMenuAction\"> \
- <menuitem name=\"Open\" action=\"OpenFile\" /> \
- <menuitem name=\"Save\" action=\"SaveFile\" /> \
- <separator name=\"Seperator\"/> \
- <menuitem name=\"Metric\" action=\"Metric\" /> \
- <menuitem name=\"Imperial\" action=\"Imperial\" /> \
- <separator name=\"Seperator\"/> \
- <menuitem name=\"Quit\" action=\"Quit\" /> \
- </menu> \
- </menubar> \
- </ui> \
-";
-
-static GtkWidget *get_menubar_menu(GtkWidget *window)
-{
- GtkActionGroup *action_group = gtk_action_group_new("Menu");
- gtk_action_group_add_actions(action_group, menu_items, nmenu_items, 0);
-
- GtkUIManager *ui_manager = gtk_ui_manager_new();
- gtk_ui_manager_insert_action_group(ui_manager, action_group, 0);
- GError* error = 0;
- gtk_ui_manager_add_ui_from_string(GTK_UI_MANAGER(ui_manager), ui_string, -1, &error);
-
- gtk_window_add_accel_group(GTK_WINDOW(window), gtk_ui_manager_get_accel_group(ui_manager));
- GtkWidget* menu = gtk_ui_manager_get_widget(ui_manager, "/MainMenu");
-
- return menu;