3

It seems to be very difficult to find quality documentation on the topic of Gtkmm.

Is there good documentation for Gtkmm? If so, where can I find it?

BobMorane
  • 3,870
  • 3
  • 20
  • 42

2 Answers2

7

Documentation is certainly not a strength of Gtkmm. Moreover, the Gtkmm API has suffered a lot of changes from one version to another, some of which are not backward compatible. However, there are some sources of information worth knowing about.

The Programming with Gtkmm book

Available here.

As the web page explains:

This book explains key concepts of the gtkmm C++ API for creating user interfaces. It also introduces the main user interface elements ("widgets").

So this is an interesting introduction. Also, the link provided above provides many copies of the book. So you can read it for Gtkmm version 2.20.1 as well as for version 4.0.1 (and other versions as well). This can be very useful.

The Gtkmm Reference Manual

Available here.

As the web page explains:

gtkmm is the official C++ interface for the popular GUI library GTK+. Highlights include typesafe callbacks, and a comprehensive set of widgets that are easily extensible via inheritance.

This is the Gtkmm API documentation. It basically looks like a Doxygen documentation for Gtkmm. It can be very useful, but is often incomplete. As with the Programming with Gtkmm page, it provides API documentation for many versions. This can be very useful when you get API compatibility problems (e.g. A method seems to no longer exist in a newer version). Do not neglect the "Related Pages" page, which can be interesting to have a quick overview of the new stuff for a particular version.

This documentation is also available offline, using DevHelp. See this SO answer on how to install it. Note that the offline version, however, offers a single version (you cannot browse across versions).

The Gtkmm demos

Available here.

As explained in the repository:

These are C++ versions of the C demos that are distributed with gtk+. You will probably find that they are easier to understand, because C++ allows much clearer organisation and reuse of code. The gtk-demo contains multiple demos of functionality and APIs that are new in gtk+3.0, and it shows the source code of the demos it is running.

These are Gtkmm examples available in the official Gtkmm repository. They can be downloaded, compiled, and played with, which is very cool. Furthermore, these demos are maintained, which means that they evolve with the Gtkmm versions. This is very useful, since you can go back in time with the repository and play with different API versions. This has saved me a couple times since I needed to use an older API version and found the current API was completely different.

If you do not want to compile them and you have Gtkmm installed, you can also run

gtk3-demo

to launch the demos for your installed Gtkmm version: enter image description here

The Gtkmm mailing list

Available here.

This mailing-list is about both the use and development of gtkmm the C++ bindings to GTK+

I have found some answers in there as well for some specific problems. However, using it directly is rather hard because there is nothing in there to help search specific topics. Most answer I found were the results of Google searches, pointing to some elements of the mailing list.

The GTK documentation

Gtkmm is essentially a C++ wrapper around GTK+ (GTK). This means that the GTK+ documentation can also be useful. I often, for example, use the Widget Gallery for Gtk3 and the Widget Gallery for Gtk4 to look at what widgets are available and how they look.

Not that some other wrappers like PyGTK can also be of help. In my experience, however, they are less interesting than the Gtk+ documentation.

Unofficial documentation

Some other web resources are also useful. Here a quick list:

  • The Gnome wiki Gtkmm project page : some random resources not available elsewhere. For example, there is an article on how to use Gtkmm with CMake.
  • Philippe Licidarme Gtkmm tutorial examples : A lot of neat examples. All source code can also be downloaded.
  • The Gedit and Inkscape repositories : These are two successful software using GTK and Gtkmm respectively. I have put the Gedit repository first even if it is written in GTK because it is with this repo that I have found the most answers.
  • The Michal B. GTK playlist : A suite of YouTube videos presenting a lot of good stuff. No in Gtkmm per se, but pretty close (GTK).
  • A bit outdated, but Prof. Stuart Weiss from Hunter College has really nice lecture notes on the topic of GTK+. These notes go in a lot of detais, the kind of details which we really would need in the official documentation, but unfortunately almost never find there.
  • GTK 3 Programming with C and Glade (GTK) - Provided by Lecrapouille.
  • Linux Gtk Glade Programming (GTK) - Provided by Lecrapouille.
  • Follow the gtkmm and gtkmm tags on SO, but also the gtk and gtk3 tags.
BobMorane
  • 3,870
  • 3
  • 20
  • 42
  • Both the book and reference manual are returning a 404 at time of writing, and they don't seem to be available anywhere else besides via web caches. – Tustin2121 Jul 30 '21 at 20:49
  • 1
    You are right... There seems to have been changes in the [Gnome developer](https://developer.gnome.org/) site. On their new site, the Gtkmm documentation is said to be available [here](https://developer.gnome.org/documentation/introduction/languages.html), but it redirects to the Gtkmm websites which in turns leads to a 404. For other programming languages, things seem to be fine. – BobMorane Aug 01 '21 at 01:25
  • 1
    The docs URL are old as well: https://developer-old.gnome.org/. They launched a new site, but only for GTK not for Gtkmm. https://docs.gtk.org/ – Melroy van den Berg Aug 26 '21 at 22:00
  • Thanks, I'll take a look at it (at least for GTK related links). – BobMorane Aug 27 '21 at 10:30
2

Here some youtube playlists: