lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Nov 25, 2002 at 02:56:43PM +0100, Andreas Rozek wrote:
>   local Window = javaNewInstance("java.awt.Frame","(Test)");
>   Window:show();
> 
>   local JavaTag = newtag();
>   settag(Window,JavaTag);

The proxies already have a user-defined tag. You have two choices:

1. Hook into the existing tag methods, like this:

do 
  oldmethod = gettagmethod(proxy_tag, "gettable")
  settagmethod(proxy_tag, "gettable",
    function(table, value)
      if this_is_my_responsibility() then
        return dosomething(table, value)
      else
        return %oldmethod(table, value)
      end
    end)
end

2. Put the proxy in a table of your own, and set the tag for that table.

- Christian