From: Anders A. <all...@gm...> - 2012-07-02 12:16:04
|
(I hope this is how you replay to a message, sorry haven't been using any mailing lists lately) On 2 July 2012 05:35, John Labenski <jla...@gm...> wrote: > On Fri, Jun 29, 2012 at 8:39 AM, Anders Andersson <all...@gm...> > wrote: > > Currently the bindings are not written, see wxLua/bindings/wxwidgets > for the others. > > I'm not sure offhand, writing the bindings is easy, but in this case a > wxLuaThread class would have to be written to call your Lua function > when Entry() is called, OnExit() called, and expose Exit(). > > The question is whether Lua can run them, I don't think the Lua stack > can do it out of the box and lua_lock() and lua_unlock() would have to > be written. > > http://lua-users.org/wiki/ThreadsTutorial > > Perhaps coroutines would work for you, the only limitation on them > with wxLua is that you cannot create an event callback in a coroutine, > but neither can you in a wxThread so it shouldn't matter. The downside > is that in a coroutine you have to manage timeslicing. > > It sounds you have a C++ app? If so, one possibility is to keep the > threads in C++ and use wxLua for other parts using wxPostEvent for > communication. > > Regards, > John > Yes, I have looked into the bindings and it seems to be that some other wx classes are missing, such as wxVListBox, wxHtmlListBox, wxServer, wxClient, wxDataViewCtrl + helper classes etc. Which I use all of them in my C++ app. that's sad I was hoping for a more feature complete wxlua. I would like to help implement them but I'm not that comfortable with the lua embedding api yet. To be totally honest I don't even know the Lua language fully yet. I have basically a wxWidgets C++ application and would like to embed a script language to allow users to create GUI in some kind of sand-boxed environment. Some of the application needs to be converted to wxLua. And it is there where wxThreads, wxVListBox, wxDataViewCtrl etc, are used (no bindings for them yet). The pros for wxLua is that the user writing the script does not have to think about pointers, memory etc. So to allow the user to use C++ code is just the opposite of what I'm trying to do. What do you think, Is it better to use wxPython instead? Although its more feature complete but it uses more memory, slower, new language, and is more difficult to embed. And if I continue with wxLua do you think it will be a big task to try to create bindings for the rest of the wxWidgets library. Thanks |