+ObMenu* menu_new(const gchar *name, const gchar *title,
+ gboolean allow_shortcut_selection, gpointer data)
+{
+ ObMenu *self;
+
+ self = g_new0(ObMenu, 1);
+ self->name = g_strdup(name);
+ self->data = data;
+
+ self->shortcut = parse_shortcut(title, allow_shortcut_selection,
+ &self->title, &self->shortcut_position,
+ &self->shortcut_always_show);
+
+ g_hash_table_replace(menu_hash, self->name, self);
+
+ /* Each menu has a single more_menu. When the menu spills past what
+ can fit on the screen, a new menu frame entry is created from this
+ more_menu, and a new menu frame for the submenu is created for this
+ menu, also pointing to the more_menu.
+
+ This can be done multiple times using the same more_menu.
+
+ more_menu->more_menu will always be NULL, since there is only 1 for
+ each menu. */
+ self->more_menu = g_new0(ObMenu, 1);
+ self->more_menu->name = _("More...");
+ self->more_menu->title = _("More...");
+ self->more_menu->data = data;
+ self->more_menu->shortcut = g_unichar_tolower(g_utf8_get_char("M"));
+
+ self->more_menu->show_func = self->show_func;
+ self->more_menu->hide_func = self->hide_func;
+ self->more_menu->update_func = self->update_func;
+ self->more_menu->execute_func = self->execute_func;
+ self->more_menu->destroy_func = self->destroy_func;
+ self->more_menu->place_func = self->place_func;
+
+ return self;
+}