gtkmm

gtkmm is a C++ wrapper for GTK, a library used to create graphical user interfaces. It is licensed using the LGPL license, so you can develop open software, free software, or even commercial non-free software using gtkmm without purchasing licenses.

gtkmm was originally named gtk-- because GTK was originally named GTK+ and had a + in the name. However, as -- is not easily indexed by search engines, the package generally went by the name gtkmm, and that's what we stuck with.

I.II.I. Why use gtkmm instead of GTK?

gtkmm vous permet d'écrire du code en se servant des techniques habituelles du C++ telles que l'encapsulation, la dérivation et le polymorphisme. En tant que programmeur C++, vous avez probablement déjà perçu que ces possibilités conduisent à un code plus clair et mieux organisé.

gtkmm possède une sécurité améliorée pour la typologie des données ; le compilateur détecte donc des erreurs qui ne seraient apparues qu'au moment de l'exécution en C. L'utilisation de ces types spécifiques rend l'API plus claire puisque vous pouvez voir les types à utiliser à la simple lecture de la déclaration d'une fonction membre.

Inheritance can be used to derive new widgets. The derivation of new widgets in GTK C code is so complicated and error prone that almost no C coders do it. As a C++ developer you know that derivation is an essential Object Orientated technique.

Member instances can be used, simplifying memory management. All GTK C widgets are dealt with by use of pointers. As a C++ coder you know that pointers should be avoided where possible.

gtkmm involves less code compared to GTK, which uses prefixed function names and lots of cast macros.

I.II.II. gtkmm comparée à Qt

Qt de Trolltech est le plus proche concurrent de gtkmm ; cela mérite une explication.

gtkmm developers tend to prefer gtkmm to Qt because gtkmm does things in a more C++ way. Qt originates from a time when C++ and the standard library were not standardised or well supported by compilers. It therefore duplicates a lot of stuff that is now in the standard library, such as containers and type information. Most significantly, Trolltech modified the C++ language to provide signals, so that Qt classes cannot be used easily with non-Qt classes. gtkmm was able to use standard C++ to provide signals without changing the C++ language. See the FAQ for more detailed differences.

I.II.III. gtkmm est un habillage

gtkmm is not a native C++ toolkit, but a C++ wrapper of a C toolkit. This separation of interface and implementation has advantages. The gtkmm developers spend most of their time talking about how gtkmm can present the clearest API, without awkward compromises due to obscure technical details. We contribute a little to the underlying GTK code base, but so do the C coders, and the Perl coders and the Python coders, etc. Therefore GTK benefits from a broader user base than language-specific toolkits - there are more implementers, more developers, more testers, and more users.