Search code examples
c++comluaactivexluacom

Create HTML GUI with Lua (HTML rendering)


I'm planning to write a quite complex GUI and potentially change it a lot. My weapon of choice is HTML/CSS. And to handle/control/manipulate it I want to use Lua. The whole thing goes into a C++ project.

The problem is, that I couldn't find an HTML rendering library for Lua. Have I maybe overlooked something?

If not, I have another idea (which unfortunately would only work under Windows):
Using luaCOM it might be possible to access an ActiveX WebBrowser Control. I don't really have an idea how this could be accomplished though... I guess I would have to create a base GUI on the C++ side which holds the ActiveX Control and then I'd have to pass the interface for it to the Lua side?

I would really appreciate it if you could help me with that.


Solution

  • wxwidgets toolkit includes WebView component, which you can access from wxlua. It's cross-platform (Windows, OSX, and Linux). Here is an example of how you can instantiate the component in wxlua. You can use a combination of HTML/CSS/JavaScript with some Lua code to generate it, but there are only few ways to get the data from WebView to your Lua code.