[][src]Trait gtk::PopoverExt

pub trait PopoverExt: 'static {
    fn bind_model<P: IsA<MenuModel>>(
        &self,
        model: Option<&P>,
        action_namespace: Option<&str>
    );
fn get_constrain_to(&self) -> PopoverConstraint;
fn get_default_widget(&self) -> Option<Widget>;
fn get_modal(&self) -> bool;
fn get_pointing_to(&self) -> Option<Rectangle>;
fn get_position(&self) -> PositionType;
fn get_relative_to(&self) -> Option<Widget>;
fn get_transitions_enabled(&self) -> bool;
fn popdown(&self);
fn popup(&self);
fn set_constrain_to(&self, constraint: PopoverConstraint);
fn set_default_widget<P: IsA<Widget>>(&self, widget: Option<&P>);
fn set_modal(&self, modal: bool);
fn set_pointing_to(&self, rect: &Rectangle);
fn set_position(&self, position: PositionType);
fn set_relative_to<P: IsA<Widget>>(&self, relative_to: Option<&P>);
fn set_transitions_enabled(&self, transitions_enabled: bool);
fn connect_closed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_constrain_to_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_modal_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_pointing_to_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_position_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_relative_to_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_transitions_enabled_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all Popover methods.

Implementors

PopoverMenu, Popover

Required methods

fn bind_model<P: IsA<MenuModel>>(
    &self,
    model: Option<&P>,
    action_namespace: Option<&str>
)

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

fn get_constrain_to(&self) -> PopoverConstraint

Returns the constraint for placing this popover. See PopoverExt::set_constrain_to.

Feature: v3_20

Returns

the constraint for placing this popover.

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

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

Feature: v3_18

Returns

the default widget, or None if there is none

fn get_modal(&self) -> bool

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

Returns

true if self is modal

fn get_pointing_to(&self) -> Option<Rectangle>

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.

rect

location to store the rectangle

Returns

true if a rectangle to point to was set.

fn get_position(&self) -> PositionType

Returns the preferred position of self.

Returns

The preferred position.

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

Returns the widget self is currently attached to

Returns

a Widget

fn get_transitions_enabled(&self) -> bool

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

Feature: v3_16

Deprecated since 3.22

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

Returns

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

fn popdown(&self)

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.

Feature: v3_22

fn popup(&self)

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.

Feature: v3_22

fn set_constrain_to(&self, constraint: PopoverConstraint)

Sets a constraint for positioning this popover.

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

Feature: v3_20

constraint

the new constraint

fn set_default_widget<P: IsA<Widget>>(&self, widget: Option<&P>)

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.

Feature: v3_18

widget

the new default widget, or None

fn set_modal(&self, modal: bool)

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

fn set_pointing_to(&self, rect: &Rectangle)

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

rect

rectangle to point to

fn set_position(&self, position: PositionType)

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

fn set_relative_to<P: IsA<Widget>>(&self, relative_to: Option<&P>)

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

fn set_transitions_enabled(&self, transitions_enabled: bool)

Sets whether show/hide transitions are enabled on this popover

Feature: v3_16

Deprecated since 3.22

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

transitions_enabled

Whether transitions are enabled

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

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

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

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

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

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

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

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

Loading content...

Implementors

impl<O: IsA<Popover>> PopoverExt for O[src]

Loading content...