diff src/bar.c @ 1520:7216f4a45698

added pane_notify_selection to pane API
author nadvornik
date Mon, 06 Apr 2009 19:53:59 +0000
parents 9c16a93a0fdf
children fffb62c7ba1e
line wrap: on
line diff
--- a/src/bar.c	Mon Apr 06 19:13:35 2009 +0000
+++ b/src/bar.c	Mon Apr 06 19:53:59 2009 +0000
@@ -304,7 +304,7 @@
 } 
 
 
-void bar_pane_set_fd_cb(GtkWidget *expander, gpointer data)
+static void bar_pane_set_fd_cb(GtkWidget *expander, gpointer data)
 {
 	GtkWidget *widget = gtk_bin_get_child(GTK_BIN(expander));
 	PaneData *pd = g_object_get_data(G_OBJECT(widget), "pane_data");
@@ -327,6 +327,23 @@
 
 }
 
+static void bar_pane_notify_selection_cb(GtkWidget *expander, gpointer data)
+{
+	GtkWidget *widget = gtk_bin_get_child(GTK_BIN(expander));
+	PaneData *pd = g_object_get_data(G_OBJECT(widget), "pane_data");
+	if (!pd) return;
+	if (pd->pane_notify_selection) pd->pane_notify_selection(widget, GPOINTER_TO_INT(data));
+}
+
+void bar_notify_selection(GtkWidget *bar, gint count)
+{
+	BarData *bd;
+	bd = g_object_get_data(G_OBJECT(bar), "bar_data");
+	if (!bd) return;
+
+	gtk_container_foreach(GTK_CONTAINER(bd->vbox), bar_pane_notify_selection_cb, GINT_TO_POINTER(count));
+}
+
 gboolean bar_event(GtkWidget *bar, GdkEvent *event)
 {
 	BarData *bd;