Skip to main content

MenuToolButtonExt

Trait MenuToolButtonExt 

Source
pub trait MenuToolButtonExt: IsA<MenuToolButton> + 'static {
    // Provided methods
    fn menu(&self) -> Option<Widget> { ... }
    fn set_arrow_tooltip_markup(&self, markup: &str) { ... }
    fn set_arrow_tooltip_text(&self, text: &str) { ... }
    fn set_menu(&self, menu: &impl IsA<Widget>) { ... }
    fn connect_show_menu<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... }
    fn connect_menu_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all MenuToolButton methods.

§Implementors

MenuToolButton

Provided Methods§

Source

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

Gets the Menu associated with MenuToolButton.

§Returns

the Menu associated with MenuToolButton

Source

fn set_arrow_tooltip_markup(&self, markup: &str)

Sets the tooltip markup text to be used as tooltip for the arrow button which pops up the menu. See ToolItemExt::set_tooltip_text() for setting a tooltip on the whole MenuToolButton.

§markup

markup text to be used as tooltip text for button’s arrow button

Source

fn set_arrow_tooltip_text(&self, text: &str)

Sets the tooltip text to be used as tooltip for the arrow button which pops up the menu. See ToolItemExt::set_tooltip_text() for setting a tooltip on the whole MenuToolButton.

§text

text to be used as tooltip text for button’s arrow button

Source

fn set_menu(&self, menu: &impl IsA<Widget>)

Sets the Menu that is popped up when the user clicks on the arrow. If menu is NULL, the arrow button becomes insensitive.

the Menu associated with MenuToolButton

Source

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

The ::show-menu signal is emitted before the menu is shown.

It can be used to populate the menu on demand, using set_menu().

Note that even if you populate the menu dynamically in this way, you must set an empty menu on the MenuToolButton beforehand, since the arrow is made insensitive if the menu is not set.

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§