:right-sidebar: True Revealer =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: Revealer(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A ``GtkRevealer`` animates the transition of its child from invisible to visible. The style of transition can be controlled with :obj:`~gi.repository.Gtk.Revealer.set_transition_type`. These animations respect the :obj:`~gi.repository.Gtk.Settings.props.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 :obj:`~gi.repository.Gtk.Revealer.props.reveal_child` property is set to :const:`False`. Accessibility ------------- ``GtkRevealer`` uses the :const:`~gi.repository.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. Constructors ------------ .. rst-class:: interim-class .. class:: Revealer :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``GtkRevealer``. Methods ------- .. rst-class:: interim-class .. class:: Revealer :no-index: .. method:: get_child() -> ~gi.repository.Gtk.Widget | None Gets the child widget of ``revealer``. .. method:: get_child_revealed() -> bool Returns whether the child is fully revealed. In other words, this returns whether the transition to the revealed state is completed. .. method:: get_reveal_child() -> bool Returns whether the child is currently revealed. This function returns :const:`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 :obj:`~gi.repository.Gtk.Revealer.get_child_revealed`. .. method:: get_transition_duration() -> int Returns the amount of time (in milliseconds) that transitions will take. .. method:: get_transition_type() -> ~gi.repository.Gtk.RevealerTransitionType Gets the type of animation that will be used for transitions in ``revealer``. .. method:: set_child(child: ~gi.repository.Gtk.Widget | None = None) -> None Sets the child widget of ``revealer``. :param child: the child widget .. method:: set_reveal_child(reveal_child: bool) -> None Tells the ``GtkRevealer`` to reveal or conceal its child. The transition will be animated with the current transition type of ``revealer``. :param reveal_child: :const:`True` to reveal the child .. method:: set_transition_duration(duration: int) -> None Sets the duration that transitions will take. :param duration: the new duration, in milliseconds .. method:: set_transition_type(transition: ~gi.repository.Gtk.RevealerTransitionType) -> None Sets the type of animation that will be used for transitions in ``revealer``. Available types include various kinds of fades and slides. :param transition: the new transition type Properties ---------- .. rst-class:: interim-class .. class:: Revealer :no-index: .. attribute:: props.child :type: ~gi.repository.Gtk.Widget The child widget. .. attribute:: props.child_revealed :type: bool Whether the child is revealed and the animation target reached. .. attribute:: props.reveal_child :type: bool Whether the revealer should reveal the child. .. attribute:: props.transition_duration :type: int The animation duration, in milliseconds. .. attribute:: props.transition_type :type: ~gi.repository.Gtk.RevealerTransitionType The type of animation used to transition.