Gtkmm


gtkmm is the official C++ interface for the popular GUI library GTK. gtkmm is free software distributed under the GNU Lesser General Public License.
gtkmm allows the creation of user interfaces either in code or with the Glade Interface Designer, using the Gtk::Builder class. Other features include typesafe callbacks, a comprehensive set of graphical control elements, and the extensibility of widgets via inheritance.

Features

Because gtkmm is the official C++ interface of the GUI library GTK, C++ programmers can use the common OOP techniques such as inheritance, and C++-specific facilities such as STL.
Main features of gtkmm are listed as follows:

//HelloWorldWindow.h
  1. ifndef HELLOWORLDWINDOW_H
  2. define HELLOWORLDWINDOW_H
  3. include
  4. include
// Derive a new window widget from an existing one.
// This window will only contain a button labelled "Hello World"
class HelloWorldWindow : public Gtk::Window
  1. endif


//HelloWorldWindow.cc
  1. include
  2. include "HelloWorldWindow.h"
HelloWorldWindow::HelloWorldWindow
: hello_world


//main.cc
  1. include
  2. include "HelloWorldWindow.h"
int main

The above program will create a window with a button labeled "Hello World". The button sends "Hello world" to standard output when clicked.
The program is run using the following commands:

$ g++ -std=c++11 *.cc -o example `pkg-config gtkmm-3.0 --cflags --libs`
$./example

This is usually done using a simple makefile.

Applications

Some notable applications that use gtkmm include: