Gio.MenuItem.new_from_model

function new_from_model(model: Gio.MenuModel, item_index: Number(gint)): Gio.MenuItem {
    // Gjs wrapper for g_menu_item_new_from_model()
}
  

Creates a Gio.MenuItem as an exact copy of an existing menu item in a Gio.MenuModel.

item_index must be valid (ie: be sure to call Gio.MenuModel.prototype.get_n_items first).

Since 2.34

model

a Gio.MenuModel

item_index

the index of an item in model

Returns

a new Gio.MenuItem.