Gio.Menu
Description: Reference for Gio.Menu

### Class

# GioMenu

since: 2.32

#### Description [src]

    final class Gio.Menu : Gio.MenuModel
    {
      /* No available fields */
    }

`GMenu` is a simple implementation of `GMenuModel`. You populate a `GMenu` by adding `GMenuItem` instances to it.

There are some convenience functions to allow you to directly add items (avoiding `GMenuItem`) for the common cases. To add a regular item, use `g_menu_insert()`. To add a section, use `g_menu_insert_section()`. To add a submenu, use `g_menu_insert_submenu()`.

Available since: 2.32

#### Ancestors

- GMenuModel
- GObject

#### Constructors

###### g_menu_new

Creates a new `GMenu`.

since: 2.32

#### Instance methods

###### g_menu_append

Convenience function for appending a normal menu item to the end of `menu`. Combine `g_menu_item_new()` and `g_menu_insert_item()` for a more flexible alternative.

since: 2.32

###### g_menu_append_item

Appends `item` to the end of `menu`.

since: 2.32

###### g_menu_append_section

Convenience function for appending a section menu item to the end of `menu`. Combine `g_menu_item_new_section()` and `g_menu_insert_item()` for a more flexible alternative.

since: 2.32

###### g_menu_append_submenu

Convenience function for appending a submenu menu item to the end of `menu`. Combine `g_menu_item_new_submenu()` and `g_menu_insert_item()` for a more flexible alternative.

since: 2.32

###### g_menu_freeze

Marks `menu` as frozen.

since: 2.32

###### g_menu_insert

Convenience function for inserting a normal menu item into `menu`. Combine `g_menu_item_new()` and `g_menu_insert_item()` for a more flexible alternative.

since: 2.32

###### g_menu_insert_item

Inserts `item` into `menu`.

since: 2.32

###### g_menu_insert_section

Convenience function for inserting a section menu item into `menu`. Combine `g_menu_item_new_section()` and `g_menu_insert_item()` for a more flexible alternative.

since: 2.32

###### g_menu_insert_submenu

Convenience function for inserting a submenu menu item into `menu`. Combine `g_menu_item_new_submenu()` and `g_menu_insert_item()` for a more flexible alternative.

since: 2.32

###### g_menu_prepend

Convenience function for prepending a normal menu item to the start of `menu`. Combine `g_menu_item_new()` and `g_menu_insert_item()` for a more flexible alternative.

since: 2.32

###### g_menu_prepend_item

Prepends `item` to the start of `menu`.

since: 2.32

###### g_menu_prepend_section

Convenience function for prepending a section menu item to the start of `menu`. Combine `g_menu_item_new_section()` and `g_menu_insert_item()` for a more flexible alternative.

since: 2.32

###### g_menu_prepend_submenu

Convenience function for prepending a submenu menu item to the start of `menu`. Combine `g_menu_item_new_submenu()` and `g_menu_insert_item()` for a more flexible alternative.

since: 2.32

###### g_menu_remove

Removes an item from the menu.

since: 2.32

###### g_menu_remove_all

Removes all items in the menu.

since: 2.38

##### Methods inherited from GMenuModel (8)

###### g_menu_model_get_item_attribute

Queries item at position `item_index` in `model` for the attribute specified by `attribute`.

since: 2.32

###### g_menu_model_get_item_attribute_value

Queries the item at position `item_index` in `model` for the attribute specified by `attribute`.

since: 2.32

###### g_menu_model_get_item_link

Queries the item at position `item_index` in `model` for the link specified by `link`.

since: 2.32

###### g_menu_model_get_n_items

Query the number of items in `model`.

since: 2.32

###### g_menu_model_is_mutable

Queries if `model` is mutable.

since: 2.32

###### g_menu_model_items_changed

Requests emission of the `GMenuModel::items-changed` signal on `model`.

since: 2.32

###### g_menu_model_iterate_item_attributes

Creates a `GMenuAttributeIter` to iterate over the attributes of the item at position `item_index` in `model`.

since: 2.32

###### g_menu_model_iterate_item_links

Creates a `GMenuLinkIter` to iterate over the links of the item at position `item_index` in `model`.

since: 2.32

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

##### Signals inherited from GMenuModel (1)

###### GMenuModel::items-changed

Emitted when a change has occurred to the menu.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.