If that is the case something like that should work:
Lua Code:
Window.mt.__tostring = function(o)
local str = ""
for k in pairs(Window.prototype) do
str = str .. k .. " " .. o[k] .. "\n"
end
return str
end
Then a simple print(w) should do it. Note that string concatenation is not efficient and you should probably use string.format instead. Also the order returned is random.