I need to write GUI applications for cross platform in C++ but since most of GUI libraries for C++ are bit tedious and I am quite familiar with C#/.NET I found out code Vala codes with GTK is quite interesting and bit easy compare with other ways.so how would I mix up VAlA with C++. I meant use VALA for front end and code rest of parts in C++.
Asked
Active
Viewed 3,448 times
2
-
possible duplicate of [Vala GUI and logic in C++](http://stackoverflow.com/questions/16885242/vala-gui-and-logic-in-c) – user Apr 07 '14 at 11:12
4 Answers
11
- You can call vala-generated code from C++, but it's plain C and quite pain to use from C++.
- Vala can only call C code, so you'd have to wrap all your C++ code in
extern "C"
one. - Using Gtk from C++ via Gtkmm is no harder than using it from Vala and Qt is not any harder either.
- Qt is the only really cross-platform option. Gtk now works natively on MacOS X, but is still not as stable. And Qt also works on most smart-phone platforms, Gtk does not.
- Vala is not that much like C# and has it's share of quriks.
In general I'd recommend using Qt instead.

Jan Hudec
- 73,652
- 13
- 125
- 172
-
1
-
@Gryphes: I never used it, but from what I saw, wxWidget design is inspired by MFC design, which is horrible and obsolete. It's not hard to use, but lacks flexibility. – Jan Hudec Jan 12 '12 at 10:40
-
2@Gryphes: Besides, wxWidget does not work on smart phone platforms either. Qt has ports for Android, iPhone, Windows CE and Symbian. – Jan Hudec Jan 12 '12 at 10:54
-
@jan-hudec nowadays there is a mature enough wxQt port to port wxWidgets to these devices using Qt. – Aug 11 '15 at 16:54
-
This by far the better answer. Actually answers the question THEN suggests an alternative – Zander Brown Apr 11 '17 at 13:06
0
It may not answer your question fully, but if you use mono to embed C# into c++, you can use GTK# directly from windows (and it will compile and run in mac and linux too).
Then, you will be able to use C#/GTK# for the front end and code rest of parts in c++.

holgac
- 1,509
- 1
- 13
- 25
-
1thanks but I am not looking for an alternative solution. I really need to make this work or at least avoid Microsoft technologies for opensource/free apps. :P – user1120193 Jan 11 '12 at 09:59
-4
You can use QT if it's meeting your requirements. Qt is a cross-platform application and UI framework with APIs for C++ programming as well. http://developer.qt.nokia.com/doc/qt-4.8/gettingstartedqt.html

Izza
- 2,389
- 8
- 38
- 60