Trait gtk::prelude::StackExt[][src]

pub trait StackExt: 'static {
Show methods fn add_named<P: IsA<Widget>>(&self, child: &P, name: &str);
fn add_titled<P: IsA<Widget>>(&self, child: &P, name: &str, title: &str);
fn child_by_name(&self, name: &str) -> Option<Widget>;
fn is_hhomogeneous(&self) -> bool;
fn is_homogeneous(&self) -> bool;
fn interpolates_size(&self) -> bool;
fn transition_duration(&self) -> u32;
fn is_transition_running(&self) -> bool;
fn transition_type(&self) -> StackTransitionType;
fn is_vhomogeneous(&self) -> bool;
fn visible_child(&self) -> Option<Widget>;
fn visible_child_name(&self) -> Option<GString>;
fn set_hhomogeneous(&self, hhomogeneous: bool);
fn set_homogeneous(&self, homogeneous: bool);
fn set_interpolate_size(&self, interpolate_size: bool);
fn set_transition_duration(&self, duration: u32);
fn set_transition_type(&self, transition: StackTransitionType);
fn set_vhomogeneous(&self, vhomogeneous: bool);
fn set_visible_child<P: IsA<Widget>>(&self, child: &P);
fn set_visible_child_full(
        &self,
        name: &str,
        transition: StackTransitionType
    );
fn set_visible_child_name(&self, name: &str);
fn child_icon_name<T: IsA<Widget>>(&self, item: &T) -> Option<GString>;
fn set_child_icon_name<T: IsA<Widget>>(
        &self,
        item: &T,
        icon_name: Option<&str>
    );
fn child_name<T: IsA<Widget>>(&self, item: &T) -> Option<GString>;
fn set_child_name<T: IsA<Widget>>(&self, item: &T, name: Option<&str>);
fn child_needs_attention<T: IsA<Widget>>(&self, item: &T) -> bool;
fn set_child_needs_attention<T: IsA<Widget>>(
        &self,
        item: &T,
        needs_attention: bool
    );
fn child_position<T: IsA<Widget>>(&self, item: &T) -> i32;
fn set_child_position<T: IsA<Widget>>(&self, item: &T, position: i32);
fn child_title<T: IsA<Widget>>(&self, item: &T) -> Option<GString>;
fn set_child_title<T: IsA<Widget>>(&self, item: &T, title: Option<&str>);
fn connect_hhomogeneous_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_homogeneous_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_interpolate_size_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_transition_duration_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_transition_running_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_transition_type_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_vhomogeneous_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_visible_child_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_visible_child_name_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Trait containing all Stack methods.

Implementors

Stack

Required methods

Adds a child to self. The child is identified by the name.

child

the widget to add

name

the name for child

Adds a child to self. The child is identified by the name. The title will be used by StackSwitcher to represent child in a tab bar, so it should be short.

child

the widget to add

name

the name for child

title

a human-readable title for child

Finds the child of the Stack with the name given as the argument. Returns None if there is no child with this name.

name

the name of the child to find

Returns

the requested child of the Stack

Gets whether self is horizontally homogeneous. See set_hhomogeneous().

Returns

whether self is horizontally homogeneous.

Gets whether self is homogeneous. See set_homogeneous().

Returns

whether self is homogeneous.

Returns wether the Stack is set up to interpolate between the sizes of children on page switch.

Returns

true if child sizes are interpolated

Returns the amount of time (in milliseconds) that transitions between pages in self will take.

Returns

the transition duration

Returns whether the self is currently in a transition from one page to another.

Returns

true if the transition is currently running, false otherwise.

Gets the type of animation that will be used for transitions between pages in self.

Returns

the current transition type of self

Gets whether self is vertically homogeneous. See set_vhomogeneous().

Returns

whether self is vertically homogeneous.

Gets the currently visible child of self, or None if there are no visible children.

Returns

the visible child of the Stack

Returns the name of the currently visible child of self, or None if there is no visible child.

Returns

the name of the visible child of the Stack

Sets the Stack to be horizontally homogeneous or not. If it is homogeneous, the Stack will request the same width for all its children. If it isn’t, the stack may change width when a different child becomes visible.

hhomogeneous

true to make self horizontally homogeneous

Sets the Stack to be homogeneous or not. If it is homogeneous, the Stack will request the same size for all its children. If it isn’t, the stack may change size when a different child becomes visible.

Since 3.16, homogeneity can be controlled separately for horizontal and vertical size, with the property::Stack::hhomogeneous and property::Stack::vhomogeneous.

homogeneous

true to make self homogeneous

Sets whether or not self will interpolate its size when changing the visible child. If the property::Stack::interpolate-size property is set to true, self will interpolate its size between the current one and the one it’ll take after changing the visible child, according to the set transition duration.

interpolate_size

the new value

Sets the duration that transitions between pages in self will take.

duration

the new duration, in milliseconds

Sets the type of animation that will be used for transitions between pages in self. Available types include various kinds of fades and slides.

The transition type can be changed without problems at runtime, so it is possible to change the animation based on the page that is about to become current.

transition

the new transition type

Sets the Stack to be vertically homogeneous or not. If it is homogeneous, the Stack will request the same height for all its children. If it isn’t, the stack may change height when a different child becomes visible.

vhomogeneous

true to make self vertically homogeneous

Makes child the visible child of self.

If child is different from the currently visible child, the transition between the two will be animated with the current transition type of self.

Note that the child widget has to be visible itself (see WidgetExt::show()) in order to become the visible child of self.

child

a child of self

Makes the child with the given name visible.

Note that the child widget has to be visible itself (see WidgetExt::show()) in order to become the visible child of self.

name

the name of the child to make visible

transition

the transition type to use

Makes the child with the given name visible.

If child is different from the currently visible child, the transition between the two will be animated with the current transition type of self.

Note that the child widget has to be visible itself (see WidgetExt::show()) in order to become the visible child of self.

name

the name of the child to make visible

Implementors