lua-users home
lua-l archive

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

On 11/26/05, Chris Marrin <> wrote:
> 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
> > 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.

I think this can work by calling the stuff in wxApp by hand. I haven't
done this myself, but there were some posts about using wxWidgets as a
plugin for photoshop that described how to do it a few years ago. It
didn't look too hard.

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

We could make a separate "module" for this. wxlua at SF is more
modular than the original so we'd just create a new module that would
generate an appropriate lib to use require with.

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

Sorry, I haven't, but it's definitely on the TODO list.

Can you point to (in your repository) what you had to do to get it to
work (in 5.0 for now) so we can duplicate it?

    John Labenski