summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkdockpanel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtkext/gtkdockpanel.c')
-rw-r--r--src/gtkext/gtkdockpanel.c51
1 files changed, 45 insertions, 6 deletions
diff --git a/src/gtkext/gtkdockpanel.c b/src/gtkext/gtkdockpanel.c
index e7bd14b..41b71aa 100644
--- a/src/gtkext/gtkdockpanel.c
+++ b/src/gtkext/gtkdockpanel.c
@@ -514,23 +514,35 @@ static void gtk_dock_panel_drag_end_cb(GtkDockPanel *dpanel, GdkDragContext *con
/******************************************************************************
* *
-* Paramètres : dpanel = composant à l'origine de la manoeuvre. *
-* context = contexte de l'opération de "Drag and drop". *
-* data = adresse non utilisée ici. *
+* Paramètres : dpanel = composant dont le contenu est à parcourir. *
+* name = désignation humaine du membre à retrouver. *
* *
-* Description : Nettoie les traces d'un "Drag and drop". *
+* Description : Retrouve un membre du panneau d'après son nom. *
* *
-* Retour : - *
+* Retour : Membre trouvé ou NULL si aucun. *
* *
* Remarques : - *
* *
******************************************************************************/
-static void gtk_dock_panel_drag_data_delete_cb(GtkDockPanel *dpanel, GdkDragContext *context, gpointer data)
+GtkDockItem *gtk_dock_panel_item_from_name(GtkDockPanel *dpanel, const char *name)
{
+ GtkDockItem *result; /* Trouvaille à remonter */
+ GList *iter; /* Boucle de parcours */
+ const char *tmp; /* Autre nom à consulter */
+ result = NULL;
+ for (iter = dpanel->ditems; iter != NULL && result == NULL; iter = g_list_next(iter))
+ {
+ tmp = gtk_dock_item_get_name(GTK_DOCK_ITEM(iter->data));
+
+ if (strcmp(name, tmp) == 0)
+ result = GTK_DOCK_ITEM(iter->data);
+ }
+
+ return result;
}
@@ -574,6 +586,32 @@ void gtk_dock_panel_add_item(GtkDockPanel *dpanel, GtkDockItem *ditem)
* *
* Paramètres : dpanel = composant GTK à mettre à jour. *
* ditem = nouvel élément à sortir. *
+* panel = nouveau panneau à présenter. *
+* *
+* Description : Remplace le panneau d'un membre actuellement affiché. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void gtk_dock_panel_replace_item_content(GtkDockPanel *dpanel, GtkDockItem *ditem, GtkWidget *panel)
+{
+ gtk_widget_ref(gtk_dock_item_get_panel(ditem));
+ gtk_container_remove(GTK_CONTAINER(dpanel->notebook), gtk_dock_item_get_panel(ditem));
+
+ gtk_dock_item_set_panel(ditem, panel);
+
+ gtk_container_add(GTK_CONTAINER(dpanel->notebook), gtk_dock_item_get_panel(ditem));
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : dpanel = composant GTK à mettre à jour. *
+* ditem = nouvel élément à sortir. *
* *
* Description : Supprime un paquet d'informations à la station dockable. *
* *
@@ -593,6 +631,7 @@ void gtk_dock_panel_remove_item(GtkDockPanel *dpanel, GtkDockItem *ditem)
printf("[rem %p from %p] list len :: %u\n", ditem, dpanel, g_list_length(dpanel->ditems));
+ gtk_widget_ref(gtk_dock_item_get_panel(ditem));
gtk_container_remove(GTK_CONTAINER(dpanel->notebook), gtk_dock_item_get_panel(ditem));
//gtk_notebook_remove_page(dpanel->notebook, pos);