Handy.Squeezer

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Handy.Squeezer Handy.Squeezer Gtk.Container->Handy.Squeezer Gtk.Orientable->Handy.Squeezer Gtk.Widget->Gtk.Container

Subclasses:None

Properties

Inherited:Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1)
Name Type Flags Short Description
homogeneous bool r/w/en Homogeneous sizing
interpolate-size bool r/w/en Whether or not the size should smoothly change when changing between differently sized children
transition-duration int r/w/en The animation duration, in milliseconds
transition-running bool r Whether or not the transition is currently running
transition-type Handy.SqueezerTransitionType r/w/en The type of animation used to transition
visible-child Gtk.Widget r/en The widget currently visible in the squeezer

Child Properties

Name Type Default Flags Short Description
enabled bool True r/w Whether the child can be picked or should be ignored when looking for the child fitting the available size best

Style Properties

Inherited:Gtk.Widget (17)

Fields

Inherited:Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name Type Access Description
parent_instance Gtk.Container r  

Class Details

class Handy.Squeezer(**kwargs)
Bases:Gtk.Container, Gtk.Orientable
Abstract:No
Structure:Handy.SqueezerClass
classmethod new()
Returns:a new Handy.Squeezer
Return type:Handy.Squeezer

Creates a new Handy.Squeezer container.

get_child_enabled(child)
Parameters:child (Gtk.Widget) – a child of self
Returns:True if child is enabled, False otherwise.
Return type:bool

Gets whether child is enabled.

See Handy.Squeezer.set_child_enabled().

get_homogeneous()
Returns:True if self is homogeneous, False is not
Return type:bool

Gets whether self is homogeneous.

See Handy.Squeezer.set_homogeneous().

New in version 0.0.10.

get_interpolate_size()
Returns:True if self interpolates its size on visible child change, False if not
Return type:bool

Gets wether self should interpolate its size on visible child change.

See Handy.Squeezer.set_interpolate_size().

New in version 0.0.10.

get_transition_duration()
Returns:the transition duration
Return type:int

Gets the amount of time (in milliseconds) that transitions between children in self will take.

get_transition_running()
Returns:True if the transition is currently running, False otherwise.
Return type:bool

Gets whether self is currently in a transition from one child to another.

get_transition_type()
Returns:the current transition type of self
Return type:Handy.SqueezerTransitionType

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

get_visible_child()
Returns:the visible child of the Handy.Squeezer
Return type:Gtk.Widget or None

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

set_child_enabled(child, enabled)
Parameters:

Make self enable or disable child. If a child is disabled, it will be ignored when looking for the child fitting the available size best. This allows to programmatically and prematurely hide a child of self even if it fits in the available space.

This can be used e.g. to ensure a certain child is hidden below a certain window width, or any other constraint you find suitable.

set_homogeneous(homogeneous)
Parameters:homogeneous (bool) – True to make self homogeneous

Sets self to be homogeneous or not. If it is homogeneous, self will request the same size for all its children for its opposite orientation, e.g. if self is oriented horizontally and is homogeneous, it will request the same height for all its children. If it isn’t, self may change size when a different child becomes visible.

New in version 0.0.10.

set_interpolate_size(interpolate_size)
Parameters:interpolate_size (bool) – True to interpolate the size

Sets whether or not self will interpolate the size of its opposing orientation when changing the visible child. If True, self will interpolate its size between the one of the previous visible child and the one of the new visible child, according to the set transition duration and the orientation, e.g. if self is horizontal, it will interpolate the its height.

New in version 0.0.10.

set_transition_duration(duration)
Parameters:duration (int) – the new duration, in milliseconds

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

set_transition_type(transition)
Parameters:transition (Handy.SqueezerTransitionType) – the new transition type

Sets the type of animation that will be used for transitions between children 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 child that is about to become current.

Property Details

Handy.Squeezer.props.homogeneous
Name:homogeneous
Type:bool
Default Value:False
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

Homogeneous sizing

Handy.Squeezer.props.interpolate_size
Name:interpolate-size
Type:bool
Default Value:False
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether or not the size should smoothly change when changing between differently sized children

Handy.Squeezer.props.transition_duration
Name:transition-duration
Type:int
Default Value:200
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

The animation duration, in milliseconds

Handy.Squeezer.props.transition_running
Name:transition-running
Type:bool
Default Value:False
Flags:READABLE

Whether or not the transition is currently running

Handy.Squeezer.props.transition_type
Name:transition-type
Type:Handy.SqueezerTransitionType
Default Value:Handy.SqueezerTransitionType.NONE
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

The type of animation used to transition

Handy.Squeezer.props.visible_child
Name:visible-child
Type:Gtk.Widget
Default Value:None
Flags:READABLE, EXPLICIT_NOTIFY

The widget currently visible in the squeezer