summaryrefslogtreecommitdiff
path: root/gtk/gtktoolbar.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2001-06-05 20:45:33 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-06-05 20:45:33 +0000
commit5e23d97ddbaf65890abfd7b0cefa83ca2c5ce4f2 (patch)
tree5df06486d9bb700ab0bab68a3970d18d201c6f87 /gtk/gtktoolbar.c
parentb32e7c9bb82396e4930957bb649a2e1cd57f00c1 (diff)
downloadgtk+-5e23d97ddbaf65890abfd7b0cefa83ca2c5ce4f2.tar.gz
new function
2001-06-05 Havoc Pennington <hp@redhat.com> * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function
Diffstat (limited to 'gtk/gtktoolbar.c')
-rw-r--r--gtk/gtktoolbar.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 1008c0f0c0..93dbadc394 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -1160,6 +1160,46 @@ gtk_toolbar_insert_space (GtkToolbar *toolbar,
}
void
+gtk_toolbar_remove_space (GtkToolbar *toolbar,
+ gint position)
+{
+ GList *children;
+ GtkToolbarChild *child;
+ gint i;
+
+ g_return_if_fail (GTK_IS_TOOLBAR (toolbar));
+
+ i = 0;
+ for (children = toolbar->children; children; children = children->next)
+ {
+ child = children->data;
+
+ if (i == position)
+ {
+ if (child->type == GTK_TOOLBAR_CHILD_SPACE)
+ {
+ toolbar->children = g_list_remove_link (toolbar->children, children);
+ g_free (child);
+ g_list_free (children);
+ toolbar->num_children--;
+
+ gtk_widget_queue_resize (GTK_WIDGET (toolbar));
+ }
+ else
+ {
+ g_warning ("Toolbar position %d is not a space", position);
+ }
+
+ return;
+ }
+
+ ++i;
+ }
+
+ g_warning ("Toolbar position %d doesn't exist", position);
+}
+
+void
gtk_toolbar_append_widget (GtkToolbar *toolbar,
GtkWidget *widget,
const gchar *tooltip_text,