diff options
author | Havoc Pennington <hp@redhat.com> | 2001-06-05 20:45:33 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2001-06-05 20:45:33 +0000 |
commit | 5e23d97ddbaf65890abfd7b0cefa83ca2c5ce4f2 (patch) | |
tree | 5df06486d9bb700ab0bab68a3970d18d201c6f87 | |
parent | b32e7c9bb82396e4930957bb649a2e1cd57f00c1 (diff) | |
download | gtk+-5e23d97ddbaf65890abfd7b0cefa83ca2c5ce4f2.tar.gz |
new function
2001-06-05 Havoc Pennington <hp@redhat.com>
* gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 4 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 4 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 4 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 4 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 4 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 4 | ||||
-rw-r--r-- | gtk/gtktoolbar.c | 40 | ||||
-rw-r--r-- | gtk/gtktoolbar.h | 2 |
9 files changed, 70 insertions, 0 deletions
@@ -1,5 +1,9 @@ 2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function + +2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value to the range that was set diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index f67f2a8918..252ae0b1e7 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,5 +1,9 @@ 2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function + +2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value to the range that was set diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f67f2a8918..252ae0b1e7 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ 2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function + +2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value to the range that was set diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index f67f2a8918..252ae0b1e7 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,5 +1,9 @@ 2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function + +2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value to the range that was set diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f67f2a8918..252ae0b1e7 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,5 +1,9 @@ 2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function + +2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value to the range that was set diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f67f2a8918..252ae0b1e7 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,9 @@ 2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function + +2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value to the range that was set diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f67f2a8918..252ae0b1e7 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,9 @@ 2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtktoolbar.c (gtk_toolbar_remove_space): new function + +2001-06-05 Havoc Pennington <hp@redhat.com> + * gtk/gtkspinbutton.c (gtk_spin_button_set_range): clamp the value to the range that was set 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, diff --git a/gtk/gtktoolbar.h b/gtk/gtktoolbar.h index 79d3d79dbc..62934110de 100644 --- a/gtk/gtktoolbar.h +++ b/gtk/gtktoolbar.h @@ -153,6 +153,8 @@ void gtk_toolbar_append_space (GtkToolbar *toolbar); void gtk_toolbar_prepend_space (GtkToolbar *toolbar); void gtk_toolbar_insert_space (GtkToolbar *toolbar, gint position); +void gtk_toolbar_remove_space (GtkToolbar *toolbar, + gint position); /* Any element type */ GtkWidget* gtk_toolbar_append_element (GtkToolbar *toolbar, |