--
-- 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
--- the Free Software Foundation; either version 2.1 of the License, or
--- (at your option) any later version.
+-- See the included file LICENSE for details.
--
local ioncore=_G.ioncore
end
-function menus.ctxmenu(reg, sub_or_chld)
+function menus.ctxmenu(reg, sub)
local m, r, s
+ if obj_is(sub, "WGroup") then
+ sub=(sub:bottom() or sub)
+ end
+
-- First, stuff between reg (inclusive) and sub_or_chld (inclusive)
-- at the top level in the menu.
- r=(sub_or_chld or reg)
+ r=(sub or reg)
while r and s~=reg do
local mm=get_ctxmenu(r, s)
m=((m and table.icat(mm, m)) or mm)