-
-/* Our menu, an array of GtkItemFactoryEntry structures that defines each menu item */
-static GtkItemFactoryEntry menu_items[] = {
- { "/_File", NULL, NULL, 0, "<Branch>", NULL },
- { "/File/_New", "<control>N", NULL, 0, "<StockItem>", GTK_STOCK_NEW },
- { "/File/_Open", "<control>O", NULL, 0, "<StockItem>", GTK_STOCK_OPEN },
- { "/File/_Save", "<control>S", NULL, 0, "<StockItem>", GTK_STOCK_SAVE },
- { "/File/Save _As", NULL, NULL, 0, "<Item>", NULL },
- { "/File/sep1", NULL, NULL, 0, "<Separator>", NULL },
- { "/File/_Quit", "<CTRL>Q", on_menu_quit, 0, "<StockItem>", GTK_STOCK_QUIT },
-
- { "/_Edit", NULL, NULL, 0, "<Branch>", NULL },
- { "/Edit/_Undo", "<CTRL>Z", NULL, 0, "<StockItem>", GTK_STOCK_UNDO },
- { "/Edit/_Redo", "<shift><CTRL>Z", NULL, 0, "<StockItem>", GTK_STOCK_REDO },
- { "/File/sep1", NULL, NULL, 0, "<Separator>", NULL },
- { "/Edit/Cut", "<control>X", NULL, 0, "<StockItem>", GTK_STOCK_CUT },
- { "/Edit/Copy", "<CTRL>C", NULL, 0, "<StockItem>", GTK_STOCK_COPY },
- { "/Edit/Paste", NULL, NULL, 0, "<StockItem>", GTK_STOCK_PASTE},
- { "/Edit/sep1", NULL, NULL, 0, "<Separator>", NULL },
- { "/Edit/Delete", "<CTRL>Q", NULL, 0, "<Item>" ,NULL},
- { "/Edit/Select all", "<CTRL>A", NULL, 0, "<Item>" ,NULL},
- { "/Edit/Deelect all", "<Shift><CTRL>A", NULL, 0, "<Item>" ,NULL},
-
- { "/_Actions", NULL, NULL, 0, "<Branch>" ,NULL},
- { "/Actions/_New Message", NULL, on_menu_new_message, 0, "<Item>",NULL },
- { "/Actions/_Reply", NULL, on_menu_reply_forward, 1, "<Item>" ,NULL},
- { "/Actions/_Forward", NULL, on_menu_reply_forward, 3, "<Item>" ,NULL},
- { "/Actions/_Bounce", NULL, NULL, 0, "<Item>",NULL },
-
- { "/_Options", NULL, NULL, 0, "<Branch>" ,NULL},
- { "/Options/_Accounts", NULL, on_menu_accounts,0, "<Item>" ,NULL},
- { "/Options/_Contacts", NULL, NULL, 0, "<Item>" ,NULL },
-
-
- { "/_Help", NULL, NULL, 0, "<Branch>" ,NULL},
- { "/_Help/About", NULL, on_menu_about, 0, "<StockItem>", GTK_STOCK_ABOUT},
-};
-
-static gint nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
-
-
-static GtkWidget *
-menubar_new (ModestMainWindow *self)
-{
- GtkItemFactory *item_factory;
- GtkAccelGroup *accel_group;
-
- /* Make an accelerator group (shortcut keys) */
- accel_group = gtk_accel_group_new ();
-
- /* Make an ItemFactory (that makes a menubar) */
- item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>",
- accel_group);
-
- /* This function generates the menu items. Pass the item factory,
- the number of items in the array, the array itself, and any
- callback data for the the menu items. */
- gtk_item_factory_create_items (item_factory, nmenu_items, menu_items, self);
-
- ///* Attach the new accelerator group to the window. */
- gtk_window_add_accel_group (GTK_WINDOW (self), accel_group);
-
- /* Finally, return the actual menu bar created by the item factory. */
- return gtk_item_factory_get_widget (item_factory, "<main>");