Whole document tree
7.6. Functions provided by GnomeAppHelperThe following is a list of the functions provided by GnomeAppHelper. 7.6.1. gnome_app_find_menu_pos - return position of a menu item7.6.1.1. DescriptionFor a menu item specified by path, returns item's parent GtkMenuShell and sets *pos to item's position in it if the item is found in the menu tree starting in GtkMenuShell root and NULL otherwise. New menus can later be inserted after the menu-item with a call to: gtk_menu_shell_insert(GTK_MENU_SHELL(parent), new_item, pos); 7.6.1.2. UsageGnomeApp *app; GtkWidget *shell; gint pos; shell = gnome_app_find_menu_pos(app->menubar, "Edit/Sort/Ascending", &pos); 7.6.1.3. Parameters
7.6.2. gnome_app_remove_menus - remove a number of menu items7.6.2.1. DescriptionThis function removes item_count items from GnomeApp's menu structure, beginning with item described by path. 7.6.2.2. Usagegnome_app_remove_menus(app, "Edit/Sort/Ascending", 2); 7.6.2.3. Parameters
7.6.3. gnome_app_insert_menus - insert menu structure in a GnomeApp's menubar7.6.3.1. DescriptionInserts menu structure described by uiinfo at position described by path. 7.6.3.2. Usagestatic GnomeUIInfo edit_menu[] = { { GNOME_APP_UI_ITEM, N_("_Copy"), N_("Copy text"), copy_callback, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_COPY, 'c', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, N_("C_ut..."), N_("Cut text"), cut_callback, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CUT, 'x', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, N_("_Paste"), N_("Paste clipboard contents"), paste_callback, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PASTE, 'v', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_END }; static GnomeUIInfo more_menus[] = { { GNOME_APP_UI_ITEM, N_("_Search..."), N_("Search for text"), search_callback, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, 's', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, N_("_Replace..."), N_("Replace text"), replace_callback, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, 'r', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_END }; static GnomeUIInfo main_menu[] = { GNOMEUIINFO_SUBTREE (N_("_Edit"), edit_menu), GNOMEUIINFO_END }; app = gnome_app_new("app", "App"); gnome_app_create_menus(app, main_menu); /* do something */ /* insert Search and Replace items after Paste */ gnome_app_insert_menus(app, "Edit/Paste", sort_menu); 7.6.3.3. Parameters
|