GUI and language

Why are GUI inserted in language? Like Java has his own GUI, C++ has his own GUI and so on. And, everytime you want to do a GUI in another language you have to learn the way it is done. Wouldn’t it be possible to have a GUI outside of a language ; like you can create a GUI with tool X (might be a language specific only to do the GUI) and then you can use code logic in Java, C++, C#, Python to complete the application.

Is the question clear?

It may sounds like a stupid question here, but well it’s not… Learning how to do GUI is already a big hassle in 1 language, learning it in many just suck and it’s always the same thing that you do.

Couldn’t you say that for any X library? My guess its a huge hassle to create anything good and supporting lots of languages.

Closest GUI that supports a lot of stuff that I know, would be http://www.telerik.com/ or http://www.devexpress.com
AJAX, WPF, WinForms, Silverlight, ASPX, VCL. But that’s really not much at all…

Swing is Java specific, but lots of GUIs are built in C or C++ and have bindings for most languages. This means they aren’t really language specific. For example Qt has bindings for Java, C++, C#, Ruby, Python and lots more. Most of the time writing GUI code is primarily about how you use the library rather then being about what language you are using. For example I recently used Qt and OpenGL in an Erlang project and for this I ported bits of OpenGL and Qt code from various Java and Python examples.

However increasingly many major GUI frameworks are XML driven, such as the awesome WPF (which uses XAML).

Edit: There are also lots of pages on user interface markup languages on Wikipedia, such as here.

It’s called a webserver and a browser.

You immediately see the problem: you get the lowest common denominator and the performance is utter crap.

Hi, I understand your question. Unfortunately it’s all not very simple.

[quote]Why are GUI inserted in language? Like Java has his own GUI, C++ has his own GUI and so on.
[/quote]
Java as a “system”, ie JVMs on many very different platforms, has its own GUI and this is helpful.

However C++ or other languages do not. You have totally different GUIs for C/C++ on Win32, Linux, Unix, etc. and even these platforms have very different GUI systems (Gnome, KDE, Xfce, Qt, etc etc).

If you use Netbeans (or Eclipse?) it’s comfortable to design small and midle-sized GUIs with the mouse and some graphically connected event handlers, plus a more code for your application’s logic.

Such a GUI’ed application you can use on many different platforms and it will look and feel very similar.

If you focus on Java and take all the “do’s and don’ts” into account, you can deliver GUI’ed applications no matter what platform they have to run on. The old Java motto “Write once run everywhere” wasn’t working very well in the beginning of Java, but since several years it is.
Everything takes its time.

[quote=“Preston,post:5,topic:35834”]
This is worthy of being a separate topic in it’s own right, but I disagree with your point here. Although I think Java is one of the best examples of cross-platform software I’ve seen it’s still far from perfect, and that’s typically found with Swing and Java2D.

Yes, it would be worth a separate topic.

The “write once run everywhere” paradigm doesn’t work perfect, indeed.
On the other side I don’t think any human work could be perfect. :slight_smile:

I agree that Swing is somewhat difficult to make look the same or say “very similar” on different platforms, mainly because of different fonts I think.

By the way, does anybody know why Java doesn’t use the same own vector fonts on any platform but relies on the platform’s fonts and just maps “similar” ones to the Java logical ones? This way we’ve to put own fonts next to our application and load them in the Java program in order to look the same or “very similar”…

A carefully written Java2D application however can look and work in exactly the same way on many different platforms, for example if it’s focused on Java2D and doesn’t use Swing too extensively.

It all depends on what your application has to do or doesn’t need to do…

Font support and minor differences in rendering wasn’t what I had in mind. I’ve seen plenty of Swing bugs where a user is using a particular Java version with a particular window manager and as a result they get no borders (or something equally bad) on any of their windows.