]> Pileus Git - ~andy/gtk/blobdiff - tests/testmenubutton.c
tests: Add test for mnemonics in GtkMenuButton
[~andy/gtk] / tests / testmenubutton.c
index cf48b2e5ec8937e82970b9f9bef0975bed529c3a..e4775ba580cabc9daf4c9fdd5afd16441afbf395 100644 (file)
@@ -37,8 +37,8 @@ int main (int argc, char **argv)
                GtkWidget *item;
                char *label;
 
-               label = g_strdup_printf ("Item %d", i);
-               item = gtk_menu_item_new_with_label (label);
+               label = g_strdup_printf ("Item _%d", i);
+               item = gtk_menu_item_new_with_mnemonic (label);
                g_free (label);
                gtk_menu_attach (GTK_MENU (menu_widget),
                                 item,
@@ -48,7 +48,7 @@ int main (int argc, char **argv)
        gtk_widget_show_all (menu_widget);
 
        button = gtk_menu_button_new ();
-       gtk_menu_button_set_menu (GTK_MENU_BUTTON (button), menu_widget);
+       gtk_menu_button_set_popup (GTK_MENU_BUTTON (button), menu_widget);
        gtk_grid_attach (GTK_GRID (grid),
                         button,
                         1, 1,
@@ -59,7 +59,7 @@ int main (int argc, char **argv)
        menu = g_menu_new ();
        for (i = 5; i > 0; i--) {
                char *label;
-               label = g_strdup_printf ("Item %d", i);
+               label = g_strdup_printf ("Item _%d", i);
                g_menu_insert (menu, i - 1, label, NULL);
                g_free (label);
        }