[]Struct gtk::MenuButton

pub struct MenuButton(_, _);

The MenuButton widget is used to display a popup when clicked on. This popup can be provided either as a Menu, a Popover or an abstract gio::MenuModel.

The MenuButton widget can hold any valid child widget. That is, it can hold almost any other standard Widget. The most commonly used child is Image. If no widget is explicitely added to the MenuButton, a Image is automatically created, using an arrow image oriented according to MenuButton:direction or the generic “open-menu-symbolic” icon if the direction is not set.

The positioning of the popup is determined by the MenuButton:direction property of the menu button.

For menus, the Widget:halign and Widget:valign properties of the menu are also taken into account. For example, when the direction is ArrowType::Down and the horizontal alignment is Align::Start, the menu will be positioned below the button, with the starting edge (depending on the text direction) of the menu aligned with the starting edge of the button. If there is not enough space below the button, the menu is popped up above the button instead. If the alignment would move part of the menu offscreen, it is “pushed in”.

Direction = Down

Direction = Up

Direction = Left

Direction = Right

CSS nodes

MenuButton has a single CSS node with name button. To differentiate it from a plain Button, it gets the .popup style class.

Implements

MenuButtonExt, ToggleButtonExt, ButtonExt, BinExt, ContainerExt, WidgetExt, glib::object::ObjectExt, BuildableExt, ActionableExt, WidgetExtManual, BuildableExtManual

Methods

impl MenuButton[src]

pub fn new() -> MenuButton[src]

Creates a new MenuButton widget with downwards-pointing arrow as the only child. You can replace the child widget with another Widget should you wish to.

Returns

The newly created MenuButton widget

Trait Implementations

impl Clone for MenuButton

impl Debug for MenuButton

impl Default for MenuButton[src]

impl Display for MenuButton[src]

impl Eq for MenuButton

impl Hash for MenuButton

impl IsA<Actionable> for MenuButton

impl IsA<Bin> for MenuButton

impl IsA<Buildable> for MenuButton

impl IsA<Button> for MenuButton

impl IsA<Container> for MenuButton

impl IsA<ToggleButton> for MenuButton

impl IsA<Widget> for MenuButton

impl Ord for MenuButton

impl<T: ObjectType> PartialEq<T> for MenuButton

impl<T: ObjectType> PartialOrd<T> for MenuButton

impl StaticType for MenuButton

Auto Trait Implementations

impl RefUnwindSafe for MenuButton

impl !Send for MenuButton

impl !Sync for MenuButton

impl Unpin for MenuButton

impl UnwindSafe for MenuButton

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.