Gio.Menu.prototype.remove

function remove(position: Number(gint)): void {
    // Gjs wrapper for g_menu_remove()
}
  

Removes an item from the menu.

position gives the index of the item to remove.

It is an error if position is not in range the range from 0 to one less than the number of items in the menu.

It is not possible to remove items by identity since items are added to the menu simply by copying their links and attributes (ie: identity of the item itself is not preserved).

Since 2.32

position

the position of the item to remove