## TeplPanelSimple

TeplPanelSimple — A set of TeplPanelItem's

## Functions

TeplPanelSimple * | tepl_panel_simple_new ()
GList * | tepl_panel_simple_get_items ()
TeplPanelItem * | tepl_panel_simple_get_active_item ()
const gchar * | tepl_panel_simple_get_active_item_name ()
void | tepl_panel_simple_set_active_item_name ()
gboolean | tepl_panel_simple_has_several_items ()

## Properties

TeplPanelItem * | active-item | Read / Write
char * | active-item-name | Read / Write

## Signals

void | add-item | Run Last
void | changed | Run First
void | remove-item | Run Last

## Types and Values

struct | TeplPanelSimple

## Object Hierarchy

        GObject
        ╰── TeplPanelSimple

## Implemented Interfaces

TeplPanelSimple implements TeplPanel.

## Includes

    #include <tepl/tepl.h>

## Description

TeplPanelSimple is a simple implementation of the TeplPanel interface, containing a set of TeplPanelItem's.

By using this class, the TeplPanelItem widgets are not yet packed into a GtkContainer. That is a job for other classes.

## Functions

### tepl_panel_simple_new ()

    TeplPanelSimple *
    tepl_panel_simple_new (void);

#### Returns

a new TeplPanelSimple object.

[transfer full]

Since: 6.11

### tepl_panel_simple_get_items ()

    GList *
    tepl_panel_simple_get_items (TeplPanelSimple *panel);

#### Parameters

panel | a TeplPanelSimple. |

#### Returns

all the items of `panel` .

[transfer full][element-type TeplPanelItem]

Since: 6.11

### tepl_panel_simple_get_active_item ()

    TeplPanelItem *
    tepl_panel_simple_get_active_item (TeplPanelSimple *panel);

#### Parameters

panel | a TeplPanelSimple. |

#### Returns

the value of the “active-item” property.

[transfer none][nullable]

Since: 6.11

### tepl_panel_simple_get_active_item_name ()

    const gchar *
    tepl_panel_simple_get_active_item_name
                                   (TeplPanelSimple *panel);

A convenience function.

#### Parameters

panel | a TeplPanelSimple. |

#### Returns

the name of the “active-item”.

[nullable]

Since: 6.11

### tepl_panel_simple_set_active_item_name ()

    void
    tepl_panel_simple_set_active_item_name
                                   (TeplPanelSimple *panel,
                                    const gchar *name);

A convenience function that calls `tepl_panel_set_active()` with the TeplPanelItem named `name` (if found).

#### Parameters

panel | a TeplPanelSimple. |
name | a name. | [nullable]

Since: 6.11

### tepl_panel_simple_has_several_items ()

    gboolean
    tepl_panel_simple_has_several_items (TeplPanelSimple *panel);

A convenience function. Useful to implement a switcher widget.

#### Parameters

panel | a TeplPanelSimple. |

#### Returns

whether `panel` has more than one TeplPanelItem.

Since: 6.11

## Types and Values

### struct TeplPanelSimple

    struct TeplPanelSimple;

## Property Details

### The `“active-item”` property

      “active-item”              TeplPanelItem *

The TeplPanelItem currently shown.

Owner: TeplPanelSimple

Flags: Read / Write

Since: 6.11

### The `“active-item-name”` property

      “active-item-name”         char *

The name of the “active-item”.

Owner: TeplPanelSimple

Flags: Read / Write

Default value: NULL

Since: 6.11

## Signal Details

### The `“add-item”` signal

    void
    user_function (TeplPanelSimple *panel,
                   TeplPanelItem   *item,
                   gpointer         user_data)

The ::add-item signal is emitted when a TeplPanelItem needs to be added.

It is a `G_SIGNAL_RUN_LAST` signal: the item is added by the TeplPanelSimple's method handler for this signal.

#### Parameters

panel | the TeplPanelSimple emitting the signal. |
item | the TeplPanelItem being added. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 6.11

### The `“changed”` signal

    void
    user_function (TeplPanelSimple *panel,
                   gpointer         user_data)

The ::changed signal is for convenience: it is emitted when the “add-item” and “remove-item” signals are emitted, and also when the “active-item” property changes.

It is a `G_SIGNAL_RUN_FIRST` signal: the action is already done.

This signal is useful if you don't need the more detailed information on what has changed.

#### Parameters

panel | the TeplPanelSimple emitting the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 6.11

### The `“remove-item”` signal

    void
    user_function (TeplPanelSimple *panel,
                   TeplPanelItem   *item,
                   gpointer         user_data)

The ::remove-item signal is emitted when a TeplPanelItem needs to be removed.

It is a `G_SIGNAL_RUN_LAST` signal: the item is removed by the TeplPanelSimple's method handler for this signal.

#### Parameters

panel | the TeplPanelSimple emitting the signal. |
item | the TeplPanelItem being removed. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 6.11