[libgd] main-toolbar: Add an add_widget method
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgd] main-toolbar: Add an add_widget method
- Date: Tue, 11 Sep 2012 07:35:18 +0000 (UTC)
commit f5cc816c2de4bf1f077b0e0b03c68b81a9f35fca
Author: Stefano Facchini <stefano facchini gmail com>
Date: Sat Sep 8 16:37:06 2012 +0200
main-toolbar: Add an add_widget method
https://bugzilla.gnome.org/show_bug.cgi?id=683632
libgd/gd-main-toolbar.c | 23 +++++++++++++++++++----
libgd/gd-main-toolbar.h | 4 ++++
2 files changed, 23 insertions(+), 4 deletions(-)
---
diff --git a/libgd/gd-main-toolbar.c b/libgd/gd-main-toolbar.c
index 9de9ddb..a217ae6 100644
--- a/libgd/gd-main-toolbar.c
+++ b/libgd/gd-main-toolbar.c
@@ -346,10 +346,7 @@ add_button_internal (GdMainToolbar *self,
button = get_empty_button (type);
}
- if (pack_start)
- gtk_container_add (GTK_CONTAINER (self->priv->left_grid), button);
- else
- gtk_container_add (GTK_CONTAINER (self->priv->right_grid), button);
+ gd_main_toolbar_add_widget (self, button, pack_start);
gtk_widget_show_all (button);
@@ -468,3 +465,21 @@ gd_main_toolbar_add_toggle (GdMainToolbar *self,
{
return add_button_internal (self, icon_name, label, pack_start, CHILD_TOGGLE);
}
+
+/**
+ * gd_main_toolbar_add_widget:
+ * @self:
+ * @widget:
+ * @pack_start:
+ *
+ */
+void
+gd_main_toolbar_add_widget (GdMainToolbar *self,
+ GtkWidget *widget,
+ gboolean pack_start)
+{
+ if (pack_start)
+ gtk_container_add (GTK_CONTAINER (self->priv->left_grid), widget);
+ else
+ gtk_container_add (GTK_CONTAINER (self->priv->right_grid), widget);
+}
diff --git a/libgd/gd-main-toolbar.h b/libgd/gd-main-toolbar.h
index 6ad8c3a..56f7b2b 100644
--- a/libgd/gd-main-toolbar.h
+++ b/libgd/gd-main-toolbar.h
@@ -94,6 +94,10 @@ GtkWidget * gd_main_toolbar_add_menu (GdMainToolbar *self,
const gchar *label,
gboolean pack_start);
+void gd_main_toolbar_add_widget (GdMainToolbar *self,
+ GtkWidget *widget,
+ gboolean pack_start);
+
G_END_DECLS
#endif /* __GD_MAIN_TOOLBAR_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]