]> Dogcows Code - chaz/openbox/commitdiff
set the functions recursively, so if you change it after the menu has been opened...
authorDana Jansens <danakj@orodu.net>
Sun, 20 May 2007 02:17:19 +0000 (02:17 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 20 May 2007 02:17:19 +0000 (02:17 +0000)
openbox/menu.c

index 80a1e12b1774d1966ab8fe42d2244bcb57ccc750..66d2ac7cd9fd4b1a878278e12a64440130c6d25a 100644 (file)
@@ -333,6 +333,13 @@ ObMenu* menu_new(const gchar *name, const gchar *title,
     self->more_menu->data = data;
     self->more_menu->shortcut = g_unichar_tolower(g_utf8_get_char("M"));
 
+    self->more_menu->show_func = self->show_func;
+    self->more_menu->hide_func = self->hide_func;
+    self->more_menu->update_func = self->update_func;
+    self->more_menu->execute_func = self->execute_func;
+    self->more_menu->destroy_func = self->destroy_func;
+    self->more_menu->place_func = self->place_func;
+
     return self;
 }
 
@@ -531,32 +538,50 @@ ObMenuEntry* menu_add_separator(ObMenu *self, gint id, const gchar *label)
 
 void menu_set_show_func(ObMenu *self, ObMenuShowFunc func)
 {
-    self->show_func = self->more_menu->show_func = func;
+    do {
+        self->show_func = func;
+        self = self->more_menu;
+    } while (self);
 }
 
 void menu_set_hide_func(ObMenu *self, ObMenuHideFunc func)
 {
-    self->hide_func = self->more_menu->hide_func = func;
+    do {
+        self->hide_func = func;
+        self = self->more_menu;
+    } while (self);
 }
 
 void menu_set_update_func(ObMenu *self, ObMenuUpdateFunc func)
 {
-    self->update_func = self->more_menu->update_func = func;
+    do {
+        self->update_func = func;
+        self = self->more_menu;
+    } while (self);
 }
 
 void menu_set_execute_func(ObMenu *self, ObMenuExecuteFunc func)
 {
-    self->execute_func = self->more_menu->execute_func = func;
+    do {
+        self->execute_func = func;
+        self = self->more_menu;
+    } while (self);
 }
 
 void menu_set_destroy_func(ObMenu *self, ObMenuDestroyFunc func)
 {
-    self->destroy_func = self->more_menu->destroy_func = func;
+    do {
+        self->destroy_func = func;
+        self = self->more_menu;
+    } while (self);
 }
 
 void menu_set_place_func(ObMenu *self, ObMenuPlaceFunc func)
 {
-    self->place_func = self->more_menu->place_func = func;
+    do {
+        self->place_func = func;
+        self = self->more_menu;
+    } while (self);
 }
 
 ObMenuEntry* menu_find_entry_id(ObMenu *self, gint id)
This page took 0.025226 seconds and 4 git commands to generate.