CtkRevealer

CtkRevealer — Hide and show with animation

Functions

Properties

gboolean child-revealed Read
gboolean reveal-child Read / Write / Construct
guint transition-duration Read / Write / Construct
CtkRevealerTransitionType transition-type Read / Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── CtkWidget
            ╰── CtkContainer
                ╰── CtkBin
                    ╰── CtkRevealer

Implemented Interfaces

CtkRevealer implements AtkImplementorIface and CtkBuildable.

Includes

#include <ctk/ctk.h>

Description

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

The style of transition can be controlled with ctk_revealer_set_transition_type().

These animations respect the “ctk-enable-animations” setting.

CSS nodes

CtkRevealer has a single CSS node with name revealer.

The CtkRevealer widget was added in CTK+ 3.10.

Functions

ctk_revealer_new ()

CtkWidget *
ctk_revealer_new (void);

Creates a new CtkRevealer.

Returns

a newly created CtkRevealer

Since: 3.10


ctk_revealer_get_reveal_child ()

gboolean
ctk_revealer_get_reveal_child (CtkRevealer *revealer);

Returns whether the child is currently revealed. See ctk_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 ctk_revealer_get_child_revealed().

Parameters

revealer

a CtkRevealer

 

Returns

TRUE if the child is revealed.

Since: 3.10


ctk_revealer_set_reveal_child ()

void
ctk_revealer_set_reveal_child (CtkRevealer *revealer,
                               gboolean reveal_child);

Tells the CtkRevealer to reveal or conceal its child.

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

Parameters

revealer

a CtkRevealer

 

reveal_child

TRUE to reveal the child

 

Since: 3.10


ctk_revealer_get_child_revealed ()

gboolean
ctk_revealer_get_child_revealed (CtkRevealer *revealer);

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

Parameters

revealer

a CtkRevealer

 

Returns

TRUE if the child is fully revealed

Since: 3.10


ctk_revealer_get_transition_duration ()

guint
ctk_revealer_get_transition_duration (CtkRevealer *revealer);

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

Parameters

revealer

a CtkRevealer

 

Returns

the transition duration

Since: 3.10


ctk_revealer_set_transition_duration ()

void
ctk_revealer_set_transition_duration (CtkRevealer *revealer,
                                      guint duration);

Sets the duration that transitions will take.

Parameters

revealer

a CtkRevealer

 

duration

the new duration, in milliseconds

 

Since: 3.10


ctk_revealer_get_transition_type ()

CtkRevealerTransitionType
ctk_revealer_get_transition_type (CtkRevealer *revealer);

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

Parameters

revealer

a CtkRevealer

 

Returns

the current transition type of revealer

Since: 3.10


ctk_revealer_set_transition_type ()

void
ctk_revealer_set_transition_type (CtkRevealer *revealer,
                                  CtkRevealerTransitionType 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 CtkRevealer

 

transition

the new transition type

 

Since: 3.10

Types and Values

struct CtkRevealer

struct CtkRevealer;

struct CtkRevealerClass

struct CtkRevealerClass {
  CtkBinClass parent_class;
};

Members


enum CtkRevealerTransitionType

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

Members

CTK_REVEALER_TRANSITION_TYPE_NONE

No transition

 

CTK_REVEALER_TRANSITION_TYPE_CROSSFADE

Fade in

 

CTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT

Slide in from the left

 

CTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT

Slide in from the right

 

CTK_REVEALER_TRANSITION_TYPE_SLIDE_UP

Slide in from the bottom

 

CTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN

Slide in from the top

 

Property Details

The “child-revealed” property

  “child-revealed”           gboolean

Whether the child is revealed and the animation target reached.

Owner: CtkRevealer

Flags: Read

Default value: FALSE


The “reveal-child” property

  “reveal-child”             gboolean

Whether the container should reveal the child.

Owner: CtkRevealer

Flags: Read / Write / Construct

Default value: FALSE


The “transition-duration” property

  “transition-duration”      guint

The animation duration, in milliseconds.

Owner: CtkRevealer

Flags: Read / Write / Construct

Default value: 250


The “transition-type” property

  “transition-type”          CtkRevealerTransitionType

The type of animation used to transition.

Owner: CtkRevealer

Flags: Read / Write / Construct

Default value: CTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN

See Also

CtkExpander