Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between different GUI toolkits and language bindings?

As far as I can tell, all GUI toolkits are basically the same.

  • They all have some sort of base Widget that everything else that can be drawn inherits from.
  • They all have basically the same widgets - Window, Scrollbar, Button, Dialog, FileSelector, DrawingArea, Menu, Container, etc.
  • They all use event driven architecture with a "main loop" that responds to user events through application registered callbacks.
  • Most have some sort of "GUI-builder" program (ala Glade for GTK+).

As far as I can tell, most language bindings to each individual toolkit are more or less a literal translation of the API. This makes it seem to me like any programming language would be just about as productive as any other.

Some toolkits bill themselves as not just a GUI toolkit, but an "application framework", for example wxWidgets. They add on APIs for other stuff like networking, data structures, logging, threading, and database access. Considering that most of this other stuff usually has better libraries to access the functionality you need, it seems like it wouldn't be particularly important in deciding between toolkits. In fact, if you know you already have this stuff covered, it would be beneficial to choose a toolkit that is simple and know it is just a GUI toolkit, like GTK+ or FLTK.

Are there GUI libraries out there that are radically different from this mold?

As someone trying to break into GUI programming, how would you suggest to choose between a GUI toolkit - or does it really even matter which one? What programming language tends to be easiest for developing GUI applications - or should I just stick with what I know?

like image 924
Greg Rogers Avatar asked Nov 05 '22 22:11

Greg Rogers


1 Answers

You're writing this question as if you've never used the these toolkits. I'm not really sure what the actual question is here. Have you ever used Swing? Does that seem as the same level of productivity as the .NET WinForms API? Really, saying anything about any of these will just lead to a flamewar or series of downvotes. There are differences. Of course, there are many similarities. A lot of that has to do with many of the fundamental constructs you need in an event driven GUI programming environment, such as a message loop. Of course, there are probably many other ways to do it but it is a proven method.

I don't know of any that "radically" break from this. Probably the most different GUI library for general purpose GUI applications I know of is from REBOL with its VIEW:

http://www.rebol.com/docs/view-guide.html

However, in reality its not "radically" different.

One big difference in productivity is the tools for these different toolkits have very different levels of maturity. You're kind of asking two questions. One question is more theoretical: "Are any of these toolkits fundamentally different?" and the other is about productivity and that is "Are there differing levels of productivity for the various toolkits?" The first question is very debatable. The second question has the clear answer: Yes.

There are many questions to ask. First what programming language or platform will you be using? Do you need portability to different platforms like Windows, Mac OS X, and Linux? Will it be just Windows or just Linux? Obviously, you wouldn't want to use WinForms on Linux (or Gnome/KDE if anyone wants to be pedantic). You could use GTK+ on Windows, but the "widgets" won't have same look and feel as those offered by native Windows toolkits. You could choose Swing, but it is really only available in Java and has its own issues. I don't think Swing has a great level of productivity, personally. I think having to add all these "adapters" and connections all this "layout" gook is not that productive. Some people do though.

Another aspect is the selection of built-in widgets your chosen toolkit holds and what the selection is among third-party free and commerical widgets. If you choose a more obscure toolkit, you won't have as many exotic sort of widgets to choose from. For instance, you would find a Mac OS X style "dock" widget for .NET WinForms and probably a few others but maybe not in GTK+ (actually, it probably exists there, but its just example).

So, in short, I don't think you can really say that all the GUI toolkits are just interchangeable. There are many other issues to consider than whether they have base widgets and message loops.

like image 74
BobbyShaftoe Avatar answered Nov 15 '22 11:11

BobbyShaftoe