From 03d42b5d8253ad2de94df20b12b9fb22ce51eb3d Mon Sep 17 00:00:00 2001 From: Scott Moynes Date: Sat, 10 May 2003 14:51:27 +0000 Subject: Timed menu that reads output from a process while the window is hidden --- openbox/menu.c | 15 +++++++++++++-- openbox/menu.h | 2 ++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'openbox') diff --git a/openbox/menu.c b/openbox/menu.c index b271cf31..74c23482 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -90,11 +90,11 @@ void menu_startup() menu_add_entry(m, menu_entry_new_submenu("subz", s)); - /* t = (Menu *)plugin_create("timed_menu"); a = action_from_string("execute"); a->data.execute.path = g_strdup("xeyes"); - menu_add_entry(t, menu_entry_new("xeyes", a));*/ + menu_add_entry(t, menu_entry_new("xeyes", a)); + menu_add_entry(m, menu_entry_new_submenu("timed", t)); s = menu_new("empty", "chub", m); menu_add_entry(m, menu_entry_new_submenu("empty", s)); @@ -293,6 +293,17 @@ void menu_hide(Menu *self) { } } +void menu_clear(Menu *self) { + GList *it; + + for (it = self->entries; it; it = it->next) { + MenuEntry *entry = it->data; + menu_entry_free(entry); + } + self->entries = NULL; +} + + MenuEntry *menu_find_entry(Menu *menu, Window win) { GList *it; diff --git a/openbox/menu.h b/openbox/menu.h index 081b3528..43ac054f 100644 --- a/openbox/menu.h +++ b/openbox/menu.h @@ -104,6 +104,8 @@ void menu_show_full(Menu *menu, int x, int y, Client *client); void menu_hide(Menu *self); +void menu_clear(Menu *self); + MenuEntry *menu_entry_new_full(char *label, Action *action, MenuEntryRenderType render_type, gpointer submenu); -- cgit v1.2.3