pub trait GtkMenuItemExt: 'static {
Show 27 methods fn deselect(&self); fn accel_path(&self) -> Option<GString>; fn label(&self) -> Option<GString>; fn must_reserve_indicator(&self) -> bool; fn submenu(&self) -> Option<Widget>; fn uses_underline(&self) -> bool; fn select(&self); fn set_accel_path(&self, accel_path: Option<&str>); fn set_label(&self, label: &str); fn set_reserve_indicator(&self, reserve: bool); fn set_submenu(&self, submenu: Option<&impl IsA<Menu>>); fn set_use_underline(&self, setting: bool); fn toggle_size_allocate(&self, allocation: i32); fn toggle_size_request(&self, requisition: &mut i32); fn is_right_justified(&self) -> bool; fn set_right_justified(&self, right_justified: bool); fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn emit_activate(&self); fn connect_activate_item<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_deselect<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_select<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_toggle_size_allocate<F: Fn(&Self, i32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_accel_path_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_label_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_right_justified_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_submenu_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_use_underline_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Required Methods

Emits the signal::MenuItem::deselect signal on the given item.

Retrieve the accelerator path that was previously set on self.

See set_accel_path() for details.

Returns

the accelerator path corresponding to this menu item’s functionality, or None if not set

Sets text on the self label

Returns

The text in the self label. This is the internal string used by the label, and must not be modified.

Returns whether the self reserves space for the submenu indicator, regardless if it has a submenu or not.

Returns

true if self always reserves space for the submenu indicator

Gets the submenu underneath this menu item, if any. See set_submenu().

Returns

submenu for this menu item, or None if none

Checks if an underline in the text indicates the next character should be used for the mnemonic accelerator key.

Returns

true if an embedded underline in the label indicates the mnemonic accelerator key.

Emits the signal::MenuItem::select signal on the given item.

Set the accelerator path on self, through which runtime changes of the menu item’s accelerator caused by the user can be identified and saved to persistent storage (see gtk_accel_map_save() on this). To set up a default accelerator for this menu item, call gtk_accel_map_add_entry() with the same accel_path. See also gtk_accel_map_add_entry() on the specifics of accelerator paths, and GtkMenuExt::set_accel_path() for a more convenient variant of this function.

This function is basically a convenience wrapper that handles calling WidgetExt::set_accel_path() with the appropriate accelerator group for the menu item.

Note that you do need to set an accelerator on the parent menu with GtkMenuExt::set_accel_group() for this to work.

Note that accel_path string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with g_intern_static_string().

accel_path

accelerator path, corresponding to this menu item’s functionality, or None to unset the current path.

Sets text on the self label

label

the text you want to set

Sets whether the self should reserve space for the submenu indicator, regardless if it actually has a submenu or not.

There should be little need for applications to call this functions.

reserve

the new value

Sets or replaces the menu item’s submenu, or removes it when a None submenu is passed.

the submenu, or None

If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.

setting

true if underlines in the text indicate mnemonics

Emits the signal::MenuItem::toggle-size-allocate signal on the given item.

allocation

the allocation to use as signal data.

Emits the signal::MenuItem::toggle-size-request signal on the given item.

requisition

the requisition to use as signal data.

Sets whether the menu item appears justified at the right side of a menu bar.

Sets whether the menu item appears justified at the right side of a menu bar.

Emitted when the item is activated.

Emitted when the item is activated, but also if the menu item has a submenu. For normal applications, the relevant signal is signal::MenuItem::activate.

Implementors