pub trait PopoverExt: 'static {
Show 24 methods fn bind_model(
        &self,
        model: Option<&impl IsA<MenuModel>>,
        action_namespace: Option<&str>
    );
fn constrain_to(&self) -> PopoverConstraint;
fn default_widget(&self) -> Option<Widget>;
fn is_modal(&self) -> bool;
fn pointing_to(&self) -> Option<Rectangle>;
fn position(&self) -> PositionType;
fn relative_to(&self) -> Option<Widget>;
fn is_transitions_enabled(&self) -> bool;
fn popdown(&self);
fn popup(&self);
fn set_constrain_to(&self, constraint: PopoverConstraint);
fn set_default_widget(&self, widget: Option<&impl IsA<Widget>>);
fn set_modal(&self, modal: bool);
fn set_pointing_to(&self, rect: &Rectangle);
fn set_position(&self, position: PositionType);
fn set_relative_to(&self, relative_to: Option<&impl IsA<Widget>>);
fn set_transitions_enabled(&self, transitions_enabled: bool);
fn connect_closed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_constrain_to_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_modal_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_pointing_to_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_position_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_relative_to_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_transitions_enabled_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Trait containing all Popover methods.

Implementors

PopoverMenu, Popover

Required methods

Establishes a binding between a Popover and a gio::MenuModel.

The contents of self are removed and then refilled with menu items according to model. When model changes, self is updated. Calling this function twice on self with different model will cause the first binding to be replaced with a binding to the new model. If model is None then any previous binding is undone and all children are removed.

If action_namespace is non-None then the effect is as if all actions mentioned in the model have their names prefixed with the namespace, plus a dot. For example, if the action “quit” is mentioned and action_namespace is “app” then the effective action name is “app.quit”.

This function uses Actionable to define the action name and target values on the created menu items. If you want to use an action group other than “app” and “win”, or if you want to use a MenuShell outside of a ApplicationWindow, then you will need to attach your own action group to the widget hierarchy using WidgetExt::insert_action_group(). As an example, if you created a group with a “quit” action and inserted it with the name “mygroup” then you would use the action name “mygroup.quit” in your gio::MenuModel.

model

the gio::MenuModel to bind to or None to remove binding

action_namespace

the namespace for actions in model

This is supported on crate feature v3_20 only.

Returns the constraint for placing this popover. See set_constrain_to().

Returns

the constraint for placing this popover.

Gets the widget that should be set as the default while the popover is shown.

Returns

the default widget, or None if there is none

Returns whether the popover is modal, see gtk_popover_set_modal to see the implications of this.

Returns

true if self is modal

If a rectangle to point to has been set, this function will return true and fill in rect with such rectangle, otherwise it will return false and fill in rect with the attached widget coordinates.

Returns

true if a rectangle to point to was set.

rect

location to store the rectangle

Returns the preferred position of self.

Returns

The preferred position.

Returns the widget self is currently attached to

Returns

a Widget

Returns whether show/hide transitions are enabled on this popover.

Deprecated since 3.22

You can show or hide the popover without transitions using WidgetExt::show() and WidgetExt::hide() while popup() and popdown() will use transitions.

Returns

true if the show and hide transitions of the given popover are enabled, false otherwise.

This is supported on crate feature v3_22 only.

Pops self down.This is different than a WidgetExt::hide() call in that it shows the popover with a transition. If you want to hide the popover without a transition, use WidgetExt::hide().

This is supported on crate feature v3_22 only.

Pops self up. This is different than a WidgetExt::show() call in that it shows the popover with a transition. If you want to show the popover without a transition, use WidgetExt::show().

This is supported on crate feature v3_20 only.

Sets a constraint for positioning this popover.

Note that not all platforms support placing popovers freely, and may already impose constraints.

constraint

the new constraint

Sets the widget that should be set as default widget while the popover is shown (see GtkWindowExt::set_default()). Popover remembers the previous default widget and reestablishes it when the popover is dismissed.

widget

the new default widget, or None

Sets whether self is modal, a modal popover will grab all input within the toplevel and grab the keyboard focus on it when being displayed. Clicking outside the popover area or pressing Esc will dismiss the popover and ungrab input.

true to make popover claim all input within the toplevel

Sets the rectangle that self will point to, in the coordinate space of the widget self is attached to, see set_relative_to().

rect

rectangle to point to

Sets the preferred position for self to appear. If the self is currently visible, it will be immediately updated.

This preference will be respected where possible, although on lack of space (eg. if close to the window edges), the Popover may choose to appear on the opposite side

position

preferred popover position

Sets a new widget to be attached to self. If self is visible, the position will be updated.

Note: the ownership of popovers is always given to their relative_to widget, so if relative_to is set to None on an attached self, it will be detached from its previous widget, and consequently destroyed unless extra references are kept.

relative_to

a Widget

Sets whether show/hide transitions are enabled on this popover

Deprecated since 3.22

You can show or hide the popover without transitions using WidgetExt::show() and WidgetExt::hide() while popup() and popdown() will use transitions.

transitions_enabled

Whether transitions are enabled

This signal is emitted when the popover is dismissed either through API or user interaction.

This is supported on crate feature v3_20 only.

Implementors