TeplStack

TeplStack — An alternative to GtkStack

Functions

Signals

void changed Run First

Types and Values

struct TeplStack

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkBin
                    ╰── TeplStack

Implemented Interfaces

TeplStack implements AtkImplementorIface and GtkBuildable.

Includes

#include <tepl/tepl.h>

Description

TeplStack is an alternative to GtkStack.

It is normally easier to implement a custom switcher widget with TeplStack. That is, a GtkWidget that controls which item is currently visible in a TeplStack.

A TeplStack contains TeplStackItem's. If the GtkWidget of a TeplStackItem is visible (according to the “visible” property), then it will be shown in the TeplStack. TeplStack doesn't enforce that a single item is visible at a time.

Functions

tepl_stack_new ()

TeplStack *
tepl_stack_new (void);

Returns

a new TeplStack.

[transfer floating]

Since: 6.6


tepl_stack_add_item ()

void
tepl_stack_add_item (TeplStack *stack,
                     TeplStackItem *item);

To add an item to a stack.

Parameters

stack

a TeplStack.

 

item

a TeplStackItem.

 

Since: 6.6


tepl_stack_remove_item ()

void
tepl_stack_remove_item (TeplStack *stack,
                        TeplStackItem *item);

Removes item from stack .

Parameters

stack

a TeplStack.

 

item

a TeplStackItem.

 

Since: 6.6


tepl_stack_get_items ()

GList *
tepl_stack_get_items (TeplStack *stack);

Parameters

stack

a TeplStack.

 

Returns

all the items of stack .

[transfer full][element-type TeplStackItem]

Since: 6.6


tepl_stack_changed ()

void
tepl_stack_changed (TeplStack *stack);

Emits the “changed” signal.

Parameters

stack

a TeplStack.

 

Since: 6.6


tepl_stack_has_several_items ()

gboolean
tepl_stack_has_several_items (TeplStack *stack);

Convenience function.

Useful to implement a switcher widget.

Parameters

stack

a TeplStack.

 

Returns

whether stack has more than one TeplStackItem.

Since: 6.6


tepl_stack_get_n_visible_items ()

guint
tepl_stack_get_n_visible_items (TeplStack *stack);

This function can serve as a sanity check. Usually what is desired is that only one item at a time is visible.

Parameters

stack

a TeplStack.

 

Returns

the number of TeplStackItem's part of stack which have their GtkWidget visible.

Since: 6.6


tepl_stack_get_visible_item ()

TeplStackItem *
tepl_stack_get_visible_item (TeplStack *stack);

Parameters

stack

a TeplStack.

 

Returns

the first TeplStackItem found in stack which has its GtkWidget visible.

[transfer none][nullable]

Since: 6.6


tepl_stack_set_visible_item ()

void
tepl_stack_set_visible_item (TeplStack *stack,
                             TeplStackItem *item);

Make the GtkWidget of item the only visible one in stack .

Parameters

stack

a TeplStack.

 

item

a TeplStackItem.

 

Since: 6.6

Types and Values

struct TeplStack

struct TeplStack;

Signal Details

The “changed” signal

void
user_function (TeplStack *stack,
               gpointer   user_data)

The ::changed signal is emitted when:

  • A TeplStackItem is added or removed from stack .

  • The visible GtkWidget item of stack has changed.

Parameters

stack

the TeplStack emitting the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First

Since: 6.6