Trait gtk::prelude::MenuButtonExt[][src]

pub trait MenuButtonExt: 'static {
Show 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<P: IsA<Widget>>(&self, align_widget: Option<&P>);
fn set_direction(&self, direction: ArrowType);
fn set_menu_model<P: IsA<MenuModel>>(&self, menu_model: Option<&P>);
fn set_popover<P: IsA<Widget>>(&self, popover: Option<&P>);
fn set_popup<P: IsA<Widget>>(&self, menu: Option<&P>);
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

Required methods

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

Returns

a Widget value or None

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

Returns

a ArrowType value

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

Returns

a gio::MenuModel or None

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

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

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

Returns

true if using a Popover

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

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

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 property::MenuButton::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 property::MenuButton::popup or property::MenuButton::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

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 property::MenuButton::menu-model or property::MenuButton::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

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 property::MenuButton::menu-model or property::MenuButton::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

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

Implementors