summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2009-01-11 05:44:18 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2009-01-11 05:44:18 +0000
commitb87add630e9920ca2ddd74753e551c483a8bcfe3 (patch)
treea5cbd8a3ee394761c5dcfbac431504ab6a340693 /tests
parentca2cfa096fb52f6407a1992f6704046bed244e1f (diff)
downloadgtk+-b87add630e9920ca2ddd74753e551c483a8bcfe3.tar.gz
Properly create a menu proxy from a GIcon. Patch by Christian Persch
* gtk/gtktoolbutton.c: Properly create a menu proxy from a GIcon. Patch by Christian Persch * tests/testtoolbar.c: Add an example with a GIcon svn path=/trunk/; revision=22084
Diffstat (limited to 'tests')
-rw-r--r--tests/testtoolbar.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/testtoolbar.c b/tests/testtoolbar.c
index 22f776199b..42e5feaea5 100644
--- a/tests/testtoolbar.c
+++ b/tests/testtoolbar.c
@@ -511,6 +511,7 @@ main (gint argc, gchar **argv)
GtkWidget *menuitem;
GtkWidget *button;
GtkWidget *label;
+ GIcon *gicon;
GSList *group;
gtk_init (&argc, &argv);
@@ -706,7 +707,14 @@ main (gint argc, gchar **argv)
add_item_to_list (store, item, "Apple");
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (item), TRUE);
-
+
+ gicon = g_content_type_get_icon ("video/ogg");
+ image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_LARGE_TOOLBAR);
+ g_object_unref (gicon);
+ item = gtk_tool_button_new (image, "Video");
+ add_item_to_list (store, item, "Video");
+ gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
+
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_table_attach (GTK_TABLE (table), hbox,