aboutsummaryrefslogtreecommitdiff
path: root/tests/test-gtk-reorder-server.c
diff options
context:
space:
mode:
authorAurelien Gateau <aurelien.gateau@canonical.com>2010-07-22 10:44:33 +0200
committerAurelien Gateau <aurelien.gateau@canonical.com>2010-07-22 10:44:33 +0200
commitfd7ffaa78b2c75db0b8138903d7272ed15641ce1 (patch)
tree01d39b5c710d7579b1c60a9c2925c16835c76602 /tests/test-gtk-reorder-server.c
parentaccf3124c2a994078cf5b2520edcd5f841922c6c (diff)
downloadlibdbusmenu-fd7ffaa78b2c75db0b8138903d7272ed15641ce1.tar.gz
libdbusmenu-fd7ffaa78b2c75db0b8138903d7272ed15641ce1.tar.bz2
libdbusmenu-fd7ffaa78b2c75db0b8138903d7272ed15641ce1.zip
Fix menu order in submenus
Diffstat (limited to 'tests/test-gtk-reorder-server.c')
-rw-r--r--tests/test-gtk-reorder-server.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/test-gtk-reorder-server.c b/tests/test-gtk-reorder-server.c
index eee9bb8..a3fadb1 100644
--- a/tests/test-gtk-reorder-server.c
+++ b/tests/test-gtk-reorder-server.c
@@ -41,17 +41,18 @@ guint ordering [NUMBER_TESTS][NUMBER_ENTRIES] = {
};
gchar * names [NUMBER_ENTRIES] = {
- "One", "Two", "Three", "Four", "Five"
+ "0", "1", "2", "3", "4"
};
DbusmenuMenuitem * entries[NUMBER_ENTRIES] = {0};
DbusmenuMenuitem * root = NULL;
-
+DbusmenuMenuitem * parent = NULL;
gint test = 0;
static DbusmenuServer * server = NULL;
static GMainLoop * mainloop = NULL;
+#if 0
static gboolean
timer_func (gpointer data)
{
@@ -65,13 +66,14 @@ timer_func (gpointer data)
int i;
for (i = 0; i < NUMBER_ENTRIES; i++) {
g_debug("Putting entry '%d' at position '%d'", i, ordering[test][i]);
- dbusmenu_menuitem_child_reorder(root, entries[i], ordering[test][i]);
+ dbusmenu_menuitem_child_reorder(parent, entries[i], ordering[test][i]);
dbusmenu_menuitem_property_set(entries[i], "label", names[ordering[test][i]]);
}
test++;
return TRUE;
}
+#endif
int
main (int argc, char ** argv)
@@ -101,13 +103,18 @@ main (int argc, char ** argv)
dbusmenu_server_set_root(server, root);
int i;
+ parent = dbusmenu_menuitem_new();
+ dbusmenu_menuitem_property_set(parent, "label", "Parent");
+ dbusmenu_menuitem_child_append(root, parent);
+
for (i = 0; i < NUMBER_ENTRIES; i++) {
entries[i] = dbusmenu_menuitem_new();
- dbusmenu_menuitem_child_append(root, entries[i]);
+ dbusmenu_menuitem_property_set(entries[i], "label", names[ordering[test][i]]);
+ dbusmenu_menuitem_child_append(parent, entries[i]);
}
- timer_func(NULL);
- g_timeout_add_seconds(5, timer_func, NULL);
+ //timer_func(NULL);
+ //g_timeout_add_seconds(5, timer_func, NULL);
mainloop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(mainloop);