Skip to main content

MenuButtonExt

Trait MenuButtonExt 

Source
pub trait MenuButtonExt: IsA<MenuButton> + 'static {
Show 18 methods // Provided methods fn align_widget(&self) -> Option<Widget> { ... } fn direction(&self) -> ArrowType { ... } fn menu_model(&self) -> Option<MenuModel> { ... } fn popover(&self) -> Option<Popover> { ... } fn popup(&self) -> Option<Menu> { ... } fn uses_popover(&self) -> bool { ... } fn set_align_widget(&self, align_widget: Option<&impl IsA<Widget>>) { ... } fn set_direction(&self, direction: ArrowType) { ... } fn set_menu_model(&self, menu_model: Option<&impl IsA<MenuModel>>) { ... } fn set_popover(&self, popover: Option<&impl IsA<Widget>>) { ... } fn set_popup(&self, menu: Option<&impl IsA<Widget>>) { ... } fn set_use_popover(&self, use_popover: bool) { ... } fn connect_align_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_direction_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_menu_model_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_popover_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_popup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_use_popover_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all MenuButton methods.

§Implementors

MenuButton

Provided Methods§

Source

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

Returns the parent Widget to use to line up with menu.

§Returns

a Widget value or None

Source

fn direction(&self) -> ArrowType

Returns the direction the popup will be pointing at when popped up.

§Returns

a ArrowType value

Source

fn menu_model(&self) -> Option<MenuModel>

Returns the gio::MenuModel used to generate the popup.

§Returns

a gio::MenuModel or None

Source

fn popover(&self) -> Option<Popover>

Returns the Popover that pops out of the button. If the button is not using a Popover, this function returns None.

§Returns

a Popover or None

Source

fn popup(&self) -> Option<Menu>

Returns the Menu that pops out of the button. If the button does not use a Menu, this function returns None.

§Returns

a Menu or None

Source

fn uses_popover(&self) -> bool

Returns whether a Popover or a Menu will be constructed from the menu model.

§Returns

true if using a Popover

Source

fn set_align_widget(&self, align_widget: Option<&impl IsA<Widget>>)

Sets the Widget to use to line the menu with when popped up. Note that the align_widget must contain the MenuButton itself.

Setting it to None means that the menu will be aligned with the button itself.

Note that this property is only used with menus currently, and not for popovers.

§align_widget

a Widget

Source

fn set_direction(&self, direction: ArrowType)

Sets the direction in which the popup will be popped up, as well as changing the arrow’s direction. The child will not be changed to an arrow if it was customized.

If the does not fit in the available space in the given direction, GTK+ will its best to keep it inside the screen and fully visible.

If you pass ArrowType::None for a direction, the popup will behave as if you passed ArrowType::Down (although you won’t see any arrows).

§direction

a ArrowType

Source

fn set_menu_model(&self, menu_model: Option<&impl IsA<MenuModel>>)

Sets the gio::MenuModel from which the popup will be constructed, or None to dissociate any existing menu model and disable the button.

Depending on the value of use-popover, either a Menu will be created with Menu::from_model(), or a Popover with Popover::from_model(). In either case, actions will be connected as documented for these functions.

If popup or popover are already set, those widgets are dissociated from the self, and those properties are set to None.

a gio::MenuModel, or None to unset and disable the button

Source

fn set_popover(&self, popover: Option<&impl IsA<Widget>>)

Sets the Popover that will be popped up when the self is clicked, or None to dissociate any existing popover and disable the button.

If menu-model or popup are set, those objects are dissociated from the self, and those properties are set to None.

§popover

a Popover, or None to unset and disable the button

Source

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

Sets the Menu that will be popped up when the self is clicked, or None to dissociate any existing menu and disable the button.

If menu-model or popover are set, those objects are dissociated from the self, and those properties are set to None.

a Menu, or None to unset and disable the button

Source

fn set_use_popover(&self, use_popover: bool)

Sets whether to construct a Popover instead of Menu when set_menu_model() is called. Note that this property is only consulted when a new menu model is set.

§use_popover

true to construct a popover from the menu model

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn connect_use_popover_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§