Functions provided by GnomeAppHelper

The following is a list of the functions provided by GnomeAppHelper.

gnome_app_find_menu_pos - return position of a menu item

GtkWidget *gnome_app_find_menu_pos(GtkWidget *root, gchar *path, gint *pos);

Description

For 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);
        

Usage

	  GnomeApp *app;
          GtkWidget *shell;
          gint pos;

          shell = gnome_app_find_menu_pos(app->menubar, "Edit/Sort/Ascending", &pos);
        

Parameters

gnome_app_remove_menus - remove a number of menu items

void gnome_app_remove_menus(GnomeApp *app, gchar *path, gint item_count);

Description

This function removes item_count items from GnomeApp's menu structure, beginning with item described by path.

Usage

            gnome_app_remove_menus(app, "Edit/Sort/Ascending", 2);
          

Parameters

gnome_app_insert_menus - insert menu structure in a GnomeApp's menubar

void gnome_app_insert_menus(GnomeApp *app, gchar *path, GnomeUIInfo *uiinfo);

Description

Inserts menu structure described by uiinfo at position described by path.

Usage

	    static 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);
          

Parameters