lua-users home
lua-l archive

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



> I hope this was my last email about this :-)

I hope not - share your success (or failure) story, I'd be interested how it turned out :)

Great, let's share :-)
I think I managed to do it, but some other bug is making it hard for me at the moment. With all the testing&trial&error code I have such bad code at the moment that I need to rewrite now and hopefully find the bug that is causing things to go wrong at the moment.

But I had it working for a moment, so I think it's ok! It's all very logical and I have very carefully investigated the Lua stack at every step to see if all was correct and all came back when I needed it.

The only thing that was still a little bit difficult was how to get from the window handle back to the light-user-data-with-metatable.
The only way I could find was the one hinted by Andrew earlier in our discussion: by creating a table in the Lua registry with the window handle as key and the light-user-data-with-metatable as value.
I don't like the Lua registry (especially because of the keys that should be carefully chosen to not mess things up - I use a lightuserdata adressed to some static C variable as key - ), but I think I needed it for this.

Or do you know if there is another/better way?