Can web technologies be used for a desktop application written in a traditional language like C++? I'd guess that they can, though I've not been able to find any evidence of this. I understand Adobe Air can make desktop apps using Flash, but it uses web languages like php etc. What I'd like to do is to be able to build my GUI elements - edit boxes, sliders, menus and so on, using html/CSS - instead of native widgets - in an application that is otherwise built in the conventional way - using Visual Studio for example.
Does anyone know if this has been done, if there's any software that makes it easier, or if there are any objections to this approach?
Qt is moving in this direction, with CSS-like styling and a forthcoming "declarative" UI mechanism.
In addition, you can drive your app with Javascript via QtScript.
You could also use QtWebKit to provide an HTML based UI, it's possible to bridge between C++ code and Javascript too.
xul uses xml and CSS to define the GUI elements.
An application I've been involved in , TomTom HOME 2 is built as a big C++ plugin in the Mozilla XulRunner framework. This framework is shared with Mozilla FireFox so there is a lot of commonality. TomTom HOME is a free (as in beer) download and the model part is in readable Javascript, so you can have a look to see how it works.
Its predecessor, TomTom HOME 1.x was built like Antony Carthy describes, wrapping the MSHTML(IE) ActiveX control, or Safari on Mac. (Disclaimer: TomTom has filed a number of patent applications to communicate with the embedded browser; the ActiveX interfaces to the JS engine are rather limited)
It's fairly easy if you have a proper MVC design, and it makes it also easy to keep the Model/View seperation clean during the implementation. You can't put in a "quick hack" in the model to expose some internal detail of the model. The View code is Javascript and it can access the C++ model only via defined interfaces.
Check out the Awesomium SDK. It's based on Chromium that powers Google Chrome. It's a bridge for your native app in C++ or .NET with an html5/js/css web UI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With