Top |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkGrid ╰── TeplPanel1
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.
TeplPanel1 *
tepl_panel1_new (void
);
Creates a new TeplPanel1 containing only an empty GtkStack that can be
retrieved with tepl_panel1_get_stack()
.
Since: 5.0
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:
A close button that hides the TeplPanel1 when clicked.
A GtkStack that can be retrieved with tepl_panel1_get_stack()
.
Since: 5.0
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.
panel |
a TeplPanel1. |
|
component |
||
name |
the name for |
|
title |
a human-readable title for |
|
icon_name |
the icon name for |
[nullable] |
Since: 5.0
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.
panel |
a TeplPanel1. |
|
settings |
a GSettings object. |
|
setting_key |
a GSettings key of type string. |
Since: 5.0
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
.
Since: 5.0
void
tepl_panel1_save_state_to_gsettings (TeplPanel1 *panel
);
Saves the current state of panel
to the provided GSettings.
Since: 5.0