lua-users home
lua-l archive

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


John Labenski wrote:

I saw that a few people have created their own versions of wxLua to
suit their own needs, as I had. I hope that with the new project at
wxlua.sourceforge.net that we can try to combine our efforts to fix
bugs and make it a little more extensible for everyone. It would be
nice to get some of the issues with wxLua mentioned on this list
fixed, but we can't fix them if we don't know what they are...

My use of wxLua is problematic because wxLua is different from any other Lua package I am using. It needs to have a wxWidgets App, which needs to be intimately tied to the Lua runtime. The only way I have seen to run a wxLua app is inside a console application that combines this wxApp with an embedded Lua runtime.

But I need to embed wxLua in my app. I would love to be able to simply include it using require "wxLua", but I don't see how that is possible today. What I ended up doing is spawing a separate OS thread and instantiating the wxApp there. But because Lua is single threaded I can't fire Lua events in that thread. So I added a callback mechanism to wxLua which allows me to have wxWidgets call a C++ event handler, which sends messages to the Lua thread to execute the code.

This all changes wxLua structurally, but allows it to plugin to an existing Lua environment.

What solutions have others come up with to deal with this? Has anyone successfully packaged wxLua to work with the 5.1 packaging system?

--
chris marrin              ,""$, "As a general rule,don't solve puzzles
chris@marrin.com        b`    $  that open portals to Hell" ,,.
        ,.`           ,b`    ,`                            , 1$'
     ,|`             mP    ,`                              :$$'     ,mm
   ,b"              b"   ,`            ,mm      m$$    ,m         ,`P$$
  m$`             ,b`  .` ,mm        ,'|$P   ,|"1$`  ,b$P       ,`  :$1
 b$`             ,$: :,`` |$$      ,`   $$` ,|` ,$$,,`"$$     .`    :$|
b$|            _m$`,:`    :$1   ,`     ,$Pm|`    `    :$$,..;"'     |$:
P$b,      _;b$$b$1"       |$$ ,`      ,$$"             ``'          $$
 ```"```'"    `"`         `""`        ""`                          ,P`