lua-users home
lua-l archive

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


>You can use luacom.StartMessageLoop to start a Windows message loop.

Thanks, that worked. All my events are successfully handled now.

> To this function, you can pass a function and a list of arguments,
> and this function will be called in each iteration of the loop:

I passed a simple "function () print ("Here") end" to this, and it does get
called - but only once, as far as I can tell? And StartMessageLoop doesn't
seem to return to my script.

>You can look at how this function is implemented to implement the same 
>thing with coroutines (so you would call yield whtn you want another 
>iteration of the message loop, instead of returning). LuaCOM had to work 
>with Lua 4.0, also, so it does not use coroutines.

I'm not familiar enough with the LUA C API to make much progress here; I can
look at the code but I don't know what it does or how to modify it.

P.