Gtk.Revealer

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Revealer Gtk.Revealer Gtk.Widget->Gtk.Revealer

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

get_child ()

get_child_revealed ()

get_reveal_child ()

get_transition_duration ()

get_transition_type ()

set_child (child)

set_reveal_child (reveal_child)

set_transition_duration (duration)

set_transition_type (transition)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

child

Gtk.Widget

r/w/en

child-revealed

bool

r

reveal-child

bool

r/w/c/en

transition-duration

int

r/w/c/en

transition-type

Gtk.RevealerTransitionType

r/w/c/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Gtk.Revealer(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

A GtkRevealer animates the transition of its child from invisible to visible.

The style of transition can be controlled with [method`Gtk`.Revealer.set_transition_type].

These animations respect the [property`Gtk`.Settings:gtk-enable-animations] setting.

CSS nodes

GtkRevealer has a single CSS node with name revealer. When styling GtkRevealer using CSS, remember that it only hides its contents, not itself. That means applied margin, padding and borders will be visible even when the [property`Gtk`.Revealer:reveal-child] property is set to False.

Accessibility

GtkRevealer uses the Gtk.AccessibleRole.GROUP role.

The child of GtkRevealer, if set, is always available in the accessibility tree, regardless of the state of the revealer widget.

classmethod new()[source]
Returns:

a newly created GtkRevealer

Return type:

Gtk.Widget

Creates a new GtkRevealer.

get_child()[source]
Returns:

the child widget of self

Return type:

Gtk.Widget or None

Gets the child widget of self.

get_child_revealed()[source]
Returns:

True if the child is fully revealed

Return type:

bool

Returns whether the child is fully revealed.

In other words, this returns whether the transition to the revealed state is completed.

get_reveal_child()[source]
Returns:

True if the child is revealed.

Return type:

bool

Returns whether the child is currently revealed.

This function returns True as soon as the transition is to the revealed state is started. To learn whether the child is fully revealed (ie the transition is completed), use [method`Gtk`.Revealer.get_child_revealed].

get_transition_duration()[source]
Returns:

the transition duration

Return type:

int

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

get_transition_type()[source]
Returns:

the current transition type of self

Return type:

Gtk.RevealerTransitionType

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

set_child(child)[source]
Parameters:

child (Gtk.Widget or None) – the child widget

Sets the child widget of self.

set_reveal_child(reveal_child)[source]
Parameters:

reveal_child (bool) – True to reveal the child

Tells the GtkRevealer to reveal or conceal its child.

The transition will be animated with the current transition type of self.

set_transition_duration(duration)[source]
Parameters:

duration (int) – the new duration, in milliseconds

Sets the duration that transitions will take.

set_transition_type(transition)[source]
Parameters:

transition (Gtk.RevealerTransitionType) – the new transition type

Sets the type of animation that will be used for transitions in self.

Available types include various kinds of fades and slides.

Property Details

Gtk.Revealer.props.child
Name:

child

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The child widget.

Gtk.Revealer.props.child_revealed
Name:

child-revealed

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the child is revealed and the animation target reached.

Gtk.Revealer.props.reveal_child
Name:

reveal-child

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

Whether the revealer should reveal the child.

Gtk.Revealer.props.transition_duration
Name:

transition-duration

Type:

int

Default Value:

250

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

The animation duration, in milliseconds.

Gtk.Revealer.props.transition_type
Name:

transition-type

Type:

Gtk.RevealerTransitionType

Default Value:

Gtk.RevealerTransitionType.SLIDE_DOWN

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

The type of animation used to transition.