]> git.decadent.org.uk Git - ion3.git/blobdiff - mod_menu/mod_menu.lua
[svn-upgrade] Integrating new upstream version, ion3 (20070203)
[ion3.git] / mod_menu / mod_menu.lua
index 6375e9f76423ada9fe59e9c9f70053810b516d8f..913ad1618673adc04d6671e86d3581249afed9da 100644 (file)
@@ -1,7 +1,7 @@
 --
 -- ion/mod_menu/mod_menu.lua -- Menu opening helper routines.
 -- 
--- Copyright (c) Tuomo Valkonen 2004-2006.
+-- Copyright (c) Tuomo Valkonen 2004-2007.
 --
 -- Ion is free software; you can redistribute it and/or modify it under
 -- the terms of the GNU Lesser General Public License as published by
@@ -29,11 +29,11 @@ assert(mod_menu and menudb)
 local function menu_(reg, sub, menu_or_name, fn, check)
     if check then
         -- Check that no other menus are open in reg.
-        local l=reg:managed_list()
-        for i, r in pairs(l) do
-            if obj_is(r, "WMenu") then
-                return
-            end
+        local ok=reg:managed_i(function(r) 
+                                   return not obj_is(r, "WMenu") 
+                               end)
+        if not ok then
+            return
         end
     end