[][src]Trait gtk::GtkMenuItemExt

pub trait GtkMenuItemExt: 'static {
    fn deselect(&self);
fn get_accel_path(&self) -> Option<GString>;
fn get_label(&self) -> Option<GString>;
fn get_reserve_indicator(&self) -> bool;
fn get_submenu(&self) -> Option<Widget>;
fn get_use_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<P: IsA<Menu>>(&self, submenu: Option<&P>);
fn set_use_underline(&self, setting: bool);
fn toggle_size_allocate(&self, allocation: i32);
fn toggle_size_request(&self, requisition: &mut i32);
fn get_property_right_justified(&self) -> bool;
fn set_property_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_property_accel_path_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_label_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_right_justified_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_submenu_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_use_underline_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all MenuItem methods.

Implementors

CheckMenuItem, MenuItem, SeparatorMenuItem

Required methods

fn deselect(&self)

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

fn get_accel_path(&self) -> Option<GString>

Retrieve the accelerator path that was previously set on self.

See GtkMenuItemExt::set_accel_path for details.

Returns

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

fn get_label(&self) -> Option<GString>

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.

fn get_reserve_indicator(&self) -> bool

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

fn get_submenu(&self) -> Option<Widget>

Gets the submenu underneath this menu item, if any. See GtkMenuItemExt::set_submenu.

Returns

submenu for this menu item, or None if none

fn get_use_underline(&self) -> bool

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.

fn select(&self)

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

fn set_accel_path(&self, accel_path: Option<&str>)

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 AccelMap::save on this). To set up a default accelerator for this menu item, call AccelMap::add_entry with the same accel_path. See also AccelMap::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 glib::Quark. 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.

fn set_label(&self, label: &str)

Sets text on the self label

label

the text you want to set

fn set_reserve_indicator(&self, reserve: bool)

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

fn set_submenu<P: IsA<Menu>>(&self, submenu: Option<&P>)

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

the submenu, or None

fn set_use_underline(&self, setting: bool)

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

fn toggle_size_allocate(&self, allocation: i32)

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

allocation

the allocation to use as signal data.

fn toggle_size_request(&self, requisition: &mut i32)

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

requisition

the requisition to use as signal data.

fn get_property_right_justified(&self) -> bool

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

fn set_property_right_justified(&self, right_justified: bool)

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

fn connect_activate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Emitted when the item is activated.

fn emit_activate(&self)

fn connect_activate_item<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

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

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_property_accel_path_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_label_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_right_justified_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_submenu_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

fn connect_property_use_underline_notify<F: Fn(&Self) + 'static>(
    &self,
    f: F
) -> SignalHandlerId

Loading content...

Implementors

impl<O: IsA<MenuItem>> GtkMenuItemExt for O[src]

Loading content...