[gtk+] Add a test for icons in menu models



commit 61ebc98a4184286e5862a302879256963162986f
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Sep 8 22:37:50 2013 -0400

    Add a test for icons in menu models
    
    testmenubutton now features an icon.

 tests/testmenubutton.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/tests/testmenubutton.c b/tests/testmenubutton.c
index 5deb570..11c35ed 100644
--- a/tests/testmenubutton.c
+++ b/tests/testmenubutton.c
@@ -69,8 +69,13 @@ int main (int argc, char **argv)
        menu = g_menu_new ();
        for (i = 5; i > 0; i--) {
                char *label;
+                GMenuItem *item;
                label = g_strdup_printf ("Item _%d", i);
-               g_menu_insert (menu, i - 1, label, NULL);
+                item = g_menu_item_new (label, NULL);
+                if (i == 3)
+                  g_menu_item_set_attribute (item, "icon", "s", "preferences-desktop-locale-symbolic");
+               g_menu_insert_item (menu, i - 1, item);
+                g_object_unref (item);
                g_free (label);
        }
        button = gtk_menu_button_new ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]