GtkRevealer: GTK+ 4 Reference Manual

## GtkRevealer GtkRevealer — Hide and show with animation |

## Functions

GtkWidget * | gtk_revealer_new ()
gboolean | gtk_revealer_get_reveal_child ()
void | gtk_revealer_set_reveal_child ()
gboolean | gtk_revealer_get_child_revealed ()
guint | gtk_revealer_get_transition_duration ()
void | gtk_revealer_set_transition_duration ()
GtkRevealerTransitionType | gtk_revealer_get_transition_type ()
void | gtk_revealer_set_transition_type ()

## Types and Values

struct | GtkRevealer
struct | GtkRevealerClass
enum | GtkRevealerTransitionType

## Includes

    #include <gtk/gtk.h>

## Description

The GtkRevealer widget is a container which animates the transition of its child from invisible to visible.

The style of transition can be controlled with `gtk_revealer_set_transition_type()`.

These animations respect the “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 “reveal-child” property is set to `FALSE`.

The GtkRevealer widget was added in GTK+ 3.10.

## Functions

### gtk_revealer_new ()

    GtkWidget *
    gtk_revealer_new (void);

Creates a new GtkRevealer.

#### Returns

a newly created GtkRevealer

Since: 3.10

### gtk_revealer_get_reveal_child ()

    gboolean
    gtk_revealer_get_reveal_child (GtkRevealer *revealer);

Returns whether the child is currently revealed. See `gtk_revealer_set_reveal_child()`.

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 `gtk_revealer_get_child_revealed()`.

#### Parameters

revealer | a GtkRevealer |

#### Returns

`TRUE` if the child is revealed.

Since: 3.10

### gtk_revealer_set_reveal_child ()

    void
    gtk_revealer_set_reveal_child (GtkRevealer *revealer,
                                   gboolean reveal_child);

Tells the GtkRevealer to reveal or conceal its child.

The transition will be animated with the current transition type of `revealer` .

#### Parameters

revealer | a GtkRevealer |
reveal_child | `TRUE` to reveal the child |

Since: 3.10

### gtk_revealer_get_child_revealed ()

    gboolean
    gtk_revealer_get_child_revealed (GtkRevealer *revealer);

Returns whether the child is fully revealed, in other words whether the transition to the revealed state is completed.

#### Parameters

revealer | a GtkRevealer |

#### Returns

`TRUE` if the child is fully revealed

Since: 3.10

### gtk_revealer_get_transition_duration ()

    guint
    gtk_revealer_get_transition_duration (GtkRevealer *revealer);

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

#### Parameters

revealer | a GtkRevealer |

#### Returns

the transition duration

Since: 3.10

### gtk_revealer_set_transition_duration ()

    void
    gtk_revealer_set_transition_duration (GtkRevealer *revealer,
                                          guint duration);

Sets the duration that transitions will take.

#### Parameters

revealer | a GtkRevealer |
duration | the new duration, in milliseconds |

Since: 3.10

### gtk_revealer_get_transition_type ()

    GtkRevealerTransitionType
    gtk_revealer_get_transition_type (GtkRevealer *revealer);

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

#### Parameters

revealer | a GtkRevealer |

#### Returns

the current transition type of `revealer`

Since: 3.10

### gtk_revealer_set_transition_type ()

    void
    gtk_revealer_set_transition_type (GtkRevealer *revealer,
                                      GtkRevealerTransitionType transition);

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

#### Parameters

revealer | a GtkRevealer |
transition | the new transition type |

Since: 3.10

## Types and Values

### struct GtkRevealer

    struct GtkRevealer {
      GtkBin parent_instance;
    };

### struct GtkRevealerClass

    struct GtkRevealerClass {
      GtkBinClass parent_class;
    };

#### Members

### enum GtkRevealerTransitionType

These enumeration values describe the possible transitions when the child of a GtkRevealer widget is shown or hidden.

#### Members

GTK_REVEALER_TRANSITION_TYPE_NONE | No transition |
GTK_REVEALER_TRANSITION_TYPE_CROSSFADE | Fade in |
GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT | Slide in from the left |
GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT | Slide in from the right |
GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP | Slide in from the bottom |
GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN | Slide in from the top |

## See Also

GtkExpander