From: John L. <jla...@gm...> - 2006-05-23 22:58:41
|
On 5/23/06, Darwin Slattery <dar...@ho...> wrote: > Hello, > > First of all thanks for such a great quality library - keep up the great > work. Thanks. > I have just started using wxlua in the GUI layer of my C++ app. I have been > using tolua++ to provide the bindings to classes in my data layer. I was > hoping to use some wx classes in my data layer e.g. wxString, but these > objects just appear as userdata in the lua runtime e.g. calling the > following function binded to by tolua++ returns userdata: > wxString getName(); wxLua uses only lua strings, to save space, easier calls to wxWidgets functions, and whatnot. It would be very easy to wrap wxStrings however, but there's a lot of functions and it might be too much bloat. We use the two functions wx2lua and lua2wx, see the top of modules/wxlua/include/wxlstate.h. You can also just use wxLua's binding generator instead of tolua++. It's really easy to create the interface files and run the generator. Take a look at bindings/wxstc for an example of how to write the rules file for a smaller semi-separate library. See also the docs about our binding generator. > Is there anyway that tolua++ bindings and the wxlua can co-exist? Can I > recast this userdata to a wxString within the lua environment? No, see above, we don't have any wxStrings and the conversion of the userdata in lua might be tricky. Regards, John Labenski |