Question:
How can I write a cross-platform GUI in C++?
1970-01-01 00:00:00 UTC
How can I write a cross-platform GUI in C++?
Five answers:
?
2016-11-28 00:46:09 UTC
This toolkit is a .internet binding for the Gtk+ toolkit. it is in lively progression, and there are countless purposes interior the Mono international that use it (Monodoc, Monocov, Mono's Debugger and various smaller purposes, a extra finished checklist is attainable on the Gtk# Wiki. structures: Unix, domicile windows, GPE, MacOS X (utilising the X server). execs: • good help for accessibility by using its Gtk+'s background. • format engine desirable for dealing with internationalized environments, and adapts to font-length without breaking purposes. • purposes combine with the Gnome laptop. • API is favourite to Gtk+ builders. • great Gtk+ community. • A Win32 port is attainable, with community seem on domicile windows XP. • The API is extremely good at this element, and syntactic sugar is being added to boost it. • Unicode help is dazzling. Cons: • Gtk+ apps run like foreign places purposes on MacOS X. • Incomplete documentation. Regards and thank you, Prakash.R
harimack
2006-10-10 14:17:41 UTC
I had to do something similear couple of times at my work. These are the 2 approaches you can take.



1. Code your logic in C++ and write the client GUI in Java, later you can use JNI to interact between Java and C++ native logic code. That why your GUI will be palform independent.



2. If you are having a Client-server architecture. Then its even better for you.



a) If you are using .NET/IIS , have server in C# and have a Java Applet client or a Java SWING client (with Java WebStart)



b) If you can write your own C++ server, your Java SWING stand-alone client can communicate with your server thru sockets.
John J
2006-10-10 13:50:40 UTC
You will have to write the code twice, this is called porting the code. Currently, the only cross platform GUI languages are all interpereted (i.e. Java).
Biskit
2006-10-10 13:30:47 UTC
The beauty of using Visual Studio is you can code the different objects in the software using different languages. For instance, you can write a web service in .NET that uses ASP, C#, and VB. It will work cross platforms.
Trak
2006-10-10 13:50:23 UTC
You can use the APIs of some widget tools like



wxWidgets

GTK

FLTK

QT



Or you can even use some parts of the mozilla code used to make firefox and thunderbrid etc... I know people from activestate.com did it, but I don't think it's the easiest way. The above ones would be a better choice.



These all provide the same interface in Windows, Unix and Mac, so you only have to write the code once and the api does the rest to try to make it the most similar in all plataforms.



You could also use some interpreted (or semi interpreted) languages instead of C++ like, Java, Python, Perl, and use their respective GUI libraries.



If you really have to do some stuff in C++ you could do some native methods in Java or stuff like that.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...