gtk+ r22084 - in trunk: . gtk tests
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r22084 - in trunk: . gtk tests
- Date: Sun, 11 Jan 2009 05:44:18 +0000 (UTC)
Author: matthiasc
Date: Sun Jan 11 05:44:18 2009
New Revision: 22084
URL: http://svn.gnome.org/viewvc/gtk+?rev=22084&view=rev
Log:
* gtk/gtktoolbutton.c: Properly create a menu proxy from a GIcon.
Patch by Christian Persch
* tests/testtoolbar.c: Add an example with a GIcon
Modified:
trunk/ChangeLog
trunk/gtk/gtktoolbutton.c
trunk/tests/testtoolbar.c
Modified: trunk/gtk/gtktoolbutton.c
==============================================================================
--- trunk/gtk/gtktoolbutton.c (original)
+++ trunk/gtk/gtktoolbutton.c Sun Jan 11 05:44:18 2009
@@ -579,6 +579,12 @@
gtk_image_get_icon_set (image, &icon_set, NULL);
return gtk_image_new_from_icon_set (icon_set, GTK_ICON_SIZE_MENU);
}
+ else if (storage_type == GTK_IMAGE_GICON)
+ {
+ GIcon *icon;
+ gtk_image_get_gicon (image, &icon, NULL);
+ return gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU);
+ }
else if (storage_type == GTK_IMAGE_PIXBUF)
{
gint width, height;
Modified: trunk/tests/testtoolbar.c
==============================================================================
--- trunk/tests/testtoolbar.c (original)
+++ trunk/tests/testtoolbar.c Sun Jan 11 05:44:18 2009
@@ -511,6 +511,7 @@
GtkWidget *menuitem;
GtkWidget *button;
GtkWidget *label;
+ GIcon *gicon;
GSList *group;
gtk_init (&argc, &argv);
@@ -706,7 +707,14 @@
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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]