# Enum `kurogane::MenuItem`

```rust
#[non_exhaustive]
pub enum MenuItem {
    Standard(StandardItem),
    App(AppItem),
    Submenu(Submenu),
    Separator,
}
```

An item of a [`ContextMenu`].

[`ContextMenu`]: https://kurogane-rs.org/docs/api/requests/contextmenu.md

## Variants

### `Standard`

```rust
Standard(StandardItem)
```

One of Kurogane's items.

### `App`

```rust
App(AppItem)
```

An item of the application's, which reports its choice to
[`App::on_context_menu_command`](https://kurogane-rs.org/docs/api/app/app.md#method.on_context_menu_command).

[crate::App::on_context_menu_command]: https://kurogane-rs.org/docs/api/app/app.md#method.on_context_menu_command

### `Submenu`

```rust
Submenu(Submenu)
```

A submenu.

### `Separator`

```rust
Separator
```

A line between groups of items. One at an edge of a menu, or next
to another, is not shown.

## Methods

### `new`

```rust
pub fn new(id: impl Into<String>, label: impl Into<String>) -> Self
```

An item of the application's. Choosing it calls
[`App::on_context_menu_command`](https://kurogane-rs.org/docs/api/app/app.md#method.on_context_menu_command)
with `id`.

In a window's menu an `&` in `label` marks the letter that chooses
it from the keyboard and `&&` shows an `&`. An embedded browser's
menu, which CEF draws, takes every `&` out of a label. There a typed
letter chooses the item whose label begins with it. A label cannot
show an `&`.

[crate::App::on_context_menu_command]: https://kurogane-rs.org/docs/api/app/app.md#method.on_context_menu_command

### `separator`

```rust
pub fn separator() -> Self
```

A line between groups of items.

### `submenu`

```rust
pub fn submenu(
    label: impl Into<String>,
    items: impl IntoIterator<Item = MenuItem>,
) -> Self
```

A submenu of `items`, under `label`.

## Trait implementations

- `impl Clone for MenuItem`
- `impl Debug for MenuItem`
- `impl Eq for MenuItem`
- `impl From<AppItem> for MenuItem`
- `impl From<StandardItem> for MenuItem`
- `impl From<Submenu> for MenuItem`
- `impl PartialEq for MenuItem`

Source: https://github.com/0x48piraj/kurogane/blob/584c586118ee53cc04604007ee038557bd859092/kurogane/src/context_menu.rs#L94
