TeplPanel1

TeplPanel1 — Side or bottom panel container

Functions

Types and Values

struct TeplPanel1

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkGrid
                    ╰── TeplPanel1

Implemented Interfaces

TeplPanel1 implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Includes

#include <tepl/tepl.h>

Description

TeplPanel1 permits to create a side or bottom panel that contains several components.

TeplPanel1 is a GtkGrid subclass containing only one child GtkWidget by default: the GtkStack that can be retrieved with tepl_panel1_get_stack().

TeplPanel1 has the "1" suffix because it's the version 1 of the TeplPanel API.

Functions

tepl_panel1_new ()

TeplPanel1 *
tepl_panel1_new (void);

Creates a new TeplPanel1 containing only an empty GtkStack that can be retrieved with tepl_panel1_get_stack().

Returns

a new TeplPanel1.

[transfer floating]

Since: 5.0


tepl_panel1_new_for_left_side_panel ()

TeplPanel1 *
tepl_panel1_new_for_left_side_panel (void);

Creates a new TeplPanel1 intended to be used as a side panel added on the left side inside a GtkWindow.

It contains:

Returns

a new left side TeplPanel1.

[transfer floating]

Since: 5.0


tepl_panel1_get_stack ()

GtkStack *
tepl_panel1_get_stack (TeplPanel1 *panel);

Parameters

panel

a TeplPanel1.

 

Returns

the GtkStack widget of panel (a direct child GtkWidget of panel ).

[transfer none]

Since: 5.0


tepl_panel1_add_component ()

void
tepl_panel1_add_component (TeplPanel1 *panel,
                           GtkWidget *component,
                           const gchar *name,
                           const gchar *title,
                           const gchar *icon_name);

The equivalent of gtk_stack_add_titled(), with an optional icon_name to set the “icon-name” GtkStack child property.

Parameters

panel

a TeplPanel1.

 

component

the child GtkWidget to add to the GtkStack of panel .

 

name

the name for component .

 

title

a human-readable title for component .

 

icon_name

the icon name for component , or NULL.

[nullable]

Since: 5.0


tepl_panel1_provide_active_component_gsetting ()

void
tepl_panel1_provide_active_component_gsetting
                               (TeplPanel1 *panel,
                                GSettings *settings,
                                const gchar *setting_key);

Provides a GSettings key for saving and restoring the “visible-child-name” property of the GtkStack belonging to panel .

This function just stores settings and setting_key for further use by tepl_panel1_restore_state_from_gsettings() and tepl_panel1_save_state_to_gsettings(). It doesn't bind the GSettings key to the property, because each main window containing a TeplPanel1 needs to be able to have a different state, and have more control over when that state is restored and saved. Once a TeplPanel1 is created and fully populated, the setting can be restored. The setting can be saved according to the current main window before creating a new main window, and of course on application exit.

Note that only one settings /setting_key pair is stored by panel for further use, if you call this function twice on the same panel , the second call overrides the first one.

Parameters

panel

a TeplPanel1.

 

settings

a GSettings object.

 

setting_key

a GSettings key of type string.

 

Since: 5.0


tepl_panel1_restore_state_from_gsettings ()

void
tepl_panel1_restore_state_from_gsettings
                               (TeplPanel1 *panel);

Restores the state of panel according to the provided GSettings.

This function must be called when all components have been added to the GtkStack of panel .

Parameters

panel

a TeplPanel1.

 

Since: 5.0


tepl_panel1_save_state_to_gsettings ()

void
tepl_panel1_save_state_to_gsettings (TeplPanel1 *panel);

Saves the current state of panel to the provided GSettings.

Parameters

panel

a TeplPanel1.

 

Since: 5.0

Types and Values

struct TeplPanel1

struct TeplPanel1;