[−][src]Trait gtk::MenuButtonExt
Required methods
fn get_align_widget(&self) -> Option<Widget>
fn get_direction(&self) -> ArrowType
fn get_menu_model(&self) -> Option<MenuModel>
fn get_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
fn get_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
fn get_use_popover(&self) -> bool
Returns whether a Popover or a Menu will be constructed
from the menu model.
Returns
true if using a Popover
fn set_align_widget<P: IsA<Widget>>(&self, align_widget: Option<&P>)
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
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
fn set_menu_model<P: IsA<MenuModel>>(&self, menu_model: Option<&P>)
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 MenuButton:use-popover, either a
Menu will be created with Menu::new_from_model, or a
Popover with Popover::new_from_model. In either case,
actions will be connected as documented for these functions.
If MenuButton:popup or MenuButton:popover are already set, those
widgets are dissociated from the self, and those properties are set
to None.
menu_model
a gio::MenuModel, or None to unset and disable the
button
fn set_popover<P: IsA<Widget>>(&self, popover: Option<&P>)
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 MenuButton:menu-model or 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
fn set_popup<P: IsA<Widget>>(&self, menu: Option<&P>)
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 MenuButton:menu-model or MenuButton:popover are set, those objects
are dissociated from the self, and those properties are set to None.
menu
a Menu, or None to unset and disable the button
fn set_use_popover(&self, use_popover: bool)
Sets whether to construct a Popover instead of Menu
when MenuButtonExt::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
fn connect_property_align_widget_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_direction_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_menu_model_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_popover_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_popup_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
fn connect_property_use_popover_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId
&self,
f: F
) -> SignalHandlerId
Implementors
impl<O: IsA<MenuButton>> MenuButtonExt for O[src]
fn get_align_widget(&self) -> Option<Widget>[src]
fn get_direction(&self) -> ArrowType[src]
fn get_menu_model(&self) -> Option<MenuModel>[src]
fn get_popover(&self) -> Option<Popover>[src]
fn get_popup(&self) -> Option<Menu>[src]
fn get_use_popover(&self) -> bool[src]
fn set_align_widget<P: IsA<Widget>>(&self, align_widget: Option<&P>)[src]
fn set_direction(&self, direction: ArrowType)[src]
fn set_menu_model<P: IsA<MenuModel>>(&self, menu_model: Option<&P>)[src]
fn set_popover<P: IsA<Widget>>(&self, popover: Option<&P>)[src]
fn set_popup<P: IsA<Widget>>(&self, menu: Option<&P>)[src]
fn set_use_popover(&self, use_popover: bool)[src]
fn connect_property_align_widget_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_direction_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_menu_model_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_popover_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_popup_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId
fn connect_property_use_popover_notify<F: Fn(&Self) + 'static>(
&self,
f: F
) -> SignalHandlerId[src]
&self,
f: F
) -> SignalHandlerId