Gio.MenuItem.set_icon

### Method

# Gio MenuItemset_icon

since: 2.38

#### Declaration [src]

    void
    g_menu_item_set_icon (
      GMenuItem* menu_item,
      GIcon* icon
    )

#### Description [src]

Sets (or unsets) the icon on `menu_item`.

This call is the same as calling `g_icon_serialize()` and using the result as the value to `g_menu_item_set_attribute_value()` for `G_MENU_ATTRIBUTE_ICON`.

This API is only intended for use with “noun” menu items; things like bookmarks or applications in an “Open With” menu. Don’t use it on menu items corresponding to verbs (eg: stock icons for ‘Save’ or ‘Quit’).

If `icon` is `NULL` then the icon is unset.

Available since: 2.38

#### Parameters

`icon`

  Type: `GIcon`

  A `GIcon`, or `NULL`.

  The data is owned by the caller of the method.