summaryrefslogtreecommitdiff
path: root/src/gui/panels
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/panels')
-rw-r--r--src/gui/panels/panel.c20
-rw-r--r--src/gui/panels/panel.h2
2 files changed, 17 insertions, 5 deletions
diff --git a/src/gui/panels/panel.c b/src/gui/panels/panel.c
index 8cc79ce..584ec09 100644
--- a/src/gui/panels/panel.c
+++ b/src/gui/panels/panel.c
@@ -37,10 +37,14 @@
-/* Support de fond pour les composants */
+/* Support de fond pour les composants. */
static GtkWidget *_support;
-/* Liste des panneaux en place */
+/* Procédure à appeler lors des changements de panneaux. */
+static GCallback _handler;
+static gpointer _data;
+
+/* Liste des panneaux en place. */
static GPanelItem *_panels_list = NULL;
@@ -261,6 +265,7 @@ void g_panel_item_dock(GPanelItem *item)
gtk_container_add(GTK_CONTAINER(_support), GTK_WIDGET(class->first));
station = gtk_dock_station_new();
+ g_signal_connect(station, "switch-widget", _handler, _data);
gtk_widget_show(station);
gtk_container_add(GTK_CONTAINER(class->first), station);
@@ -425,6 +430,8 @@ static void create_panel_division(GtkWidget *parent, GtkWidget *child1, const ch
if (!GTK_IS_DOCK_STATION(child1))
{
station = gtk_dock_station_new();
+ g_signal_connect(station, "switch-widget", _handler, _data);
+
gtk_widget_show(station);
gtk_dock_panel_add_widget(GTK_DOCK_STATION(station), child1, name1);
@@ -435,6 +442,8 @@ static void create_panel_division(GtkWidget *parent, GtkWidget *child1, const ch
if (!GTK_IS_DOCK_STATION(child2))
{
station = gtk_dock_station_new();
+ g_signal_connect(station, "switch-widget", _handler, _data);
+
gtk_widget_show(station);
gtk_dock_panel_add_widget(GTK_DOCK_STATION(station), child2, name2);
@@ -609,7 +618,8 @@ static void _g_panel_item_dock(GtkWidget *base, GEditorItem *item, const char *p
/******************************************************************************
* *
-* Paramètres : - *
+* Paramètres : handler = procédure à réveiller en cas de changements. *
+* data = donnée à faire suivre. *
* *
* Description : Prépare le terrain pour l'affichage central. *
* *
@@ -619,7 +629,7 @@ static void _g_panel_item_dock(GtkWidget *base, GEditorItem *item, const char *p
* *
******************************************************************************/
-GtkWidget *init_panels2(void)
+GtkWidget *init_panels2(GCallback handler, gpointer data)
{
GtkWidget *result; /* Support à retourner */
@@ -627,6 +637,8 @@ GtkWidget *init_panels2(void)
gtk_widget_show(result);
_support = result;
+ _handler = handler;
+ _data = data;
return result;
diff --git a/src/gui/panels/panel.h b/src/gui/panels/panel.h
index afdce93..dd9ae5e 100644
--- a/src/gui/panels/panel.h
+++ b/src/gui/panels/panel.h
@@ -63,7 +63,7 @@ void g_panel_item_dock(GPanelItem *);
/* Prépare le terrain pour l'affichage central. */
-GtkWidget *init_panels2(void);
+GtkWidget *init_panels2(GCallback, gpointer);
/* Charge les principaux panneaux de l'éditeur. */
void load_main_panels(void);